EF4 Enable Do Not Return Any Navigation Properties

I use this

  public IQueryable<Document> GetDocuments()
    {
        return this.ObjectContext.Documents.Include("Company").Include("PostingStatus").Include("DocumentType").Include("Period");
    }

in my domain, but it does not return anything to the client. I use the WCF RIA and EF4 and Silverlight services.

Does this have anything to do with some changes in EF4 regarding the internal and external connections that he used to work in the previous version of EF, but does not know what is going wrong. Can you talk about this.

Thanks Aashish Gupta

+3
source share
2 answers

WCF RIA Services EF4, ​​ [Include] * * DomainService.metadata.cs.

: http://xamlgeek.net/2010/02/21/include-related-properties-in-wcf-ria-services/

, DomainService.

+2

, , , ,

  (documentDomainDataSource.DomainContext as DocumentContext).AddReference(typeof(Company), company_ctx);
        (documentDomainDataSource.DomainContext as DocumentContext).AddReference(typeof(DocumentType), documentType_ctx);
        (documentDomainDataSource.DomainContext as DocumentContext).AddReference(typeof(Period), periods_ctx);

, , Entity Framework ria.

0

Source: https://habr.com/ru/post/1767662/


All Articles