EF4 包括不返回任何导航属性
我在我的域服务中使用它
public IQueryable<Document> GetDocuments()
{
return this.ObjectContext.Documents.Include("Company").Include("PostingStatus").Include("DocumentType").Include("Period");
}
,但它没有向客户端返回任何内容,我正在使用 WCF RIA 服务以及 EF4 和 Silverlight。
这是否与 EF4 中关于内部和外部联接的一些更改有关,它曾经在以前的 EF 版本中工作,但不知道出了什么问题。 你能解释一下吗?
谢谢, 阿什什·古普塔
I am using this
public IQueryable<Document> GetDocuments()
{
return this.ObjectContext.Documents.Include("Company").Include("PostingStatus").Include("DocumentType").Include("Period");
}
in my domainservice but its not returning anything to the client i am using WCF RIA Services and EF4 and Silverlight.
Does this have anything to do with some changes in EF4 regarding inner and outer joins it used to work in previous version of EF but dont know whats going on wrong.
Can you throw some light on this.
Thanks,
Aashish Gupta
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 WCF RIA 服务和 EF4 中遇到了同样的问题,通过手动将
[Include]
属性添加到生成的“*DomainService.metadata.cs”文件中的相应导航属性来修复该问题。另请参阅:http://xamlgeek.net /2010/02/21/include-lated-properties-in-wcf-ria-services/
不利的一面是,在重新生成 DomainService 文件时,此属性会被消除。
I had the same problem in my WCF RIA Services and EF4, which was fixed by manually adding the
[Include]
attribute to the appropriate navigation properties within the generated "*DomainService.metadata.cs" file.See also: http://xamlgeek.net/2010/02/21/include-related-properties-in-wcf-ria-services/
On the downside, this attribute gets blown away when regenerating the DomainService files.
我已经上传了文件并尝试了一切,但当我在客户端上像这样外部指定时它似乎不起作用,
然后它就可以工作,但这不是我使用实体框架和 ria 服务的解决方案。
I have uploaded the file and tried everything but it doesn't seem to work when on the client i externally specify like this
then it works but this is not the solution for which i am using Entity Framework and ria services.