OA Casting problem !!

1 posts, 0 answers
  1. Ubuntu
    Ubuntu avatar
    89 posts
    Member since:
    Jul 2012

    Posted 25 Apr 2011 Link to this post

    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
Back to Top