This is a migrated thread and some comments may be shown as answers.

OA Casting problem !!

0 Answers 13 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
Ubuntu
Top achievements
Rank 1
Ubuntu asked on 25 Apr 2011, 04:28 PM
Dear all,

I have successfully implemented the Fetchplan using OA ORM as follows:
Define the Include & association on the member at the metaclass as follows:
[Include]
[Association("summaryChildren", "number", "number")]
public IList<detail> details { get; private set; }

then create the method to implement the FetchPlan as follows:
public dailysummery GetSummaryWithDetails(decimal number, int id)
{
    FetchStrategy summaryfs = new FetchStrategy();
    summaryfs.LoadWith<summery>(s=>s.details);
    DataContext.FetchStrategy = summaryfs;
    dailysummery summary = (from dsummery in DataContext.summeries
                                where dsummery.number == number
                                      && dsummery.id == id
                                select dsummery).SingleOrDefault();
    return summary;
}

In the SL client I have two QueryableDomainServiceCollectionView to hold the data back from the GetSummaryWithDetails as follows: 
CurrentSummary = DS.GetSummaryWithDetails(1,2);
CurrentDetails = CurrentSummary.details.AsQueryable() as QueryableDomainServiceCollectionView<detail>;

but the second line is not working .. what is the problem with the cast here ...

Also, I would like to know If my implementation of the FetchPlan is correct ...

Regards

No answers yet. Maybe you can help?

Tags
DomainDataSource
Asked by
Ubuntu
Top achievements
Rank 1
Share this question
or