根据选择获取相关实体的简洁方法
我正在使用 C# 和 EF 4。我有一个 Actor 存储库。实体 Actor 与 Movie 具有多对多关系。 因此,在 ActorReposity 中,我想要一个方法示例 GetActors,其工资大于 100,并且在结果中我想包含该演员曾出演过的电影,其导演是 Doe。(导演是电影的财产) ) 我在存储库中的方法的签名是 IQueryable GetActors()。在这种情况下,我只是简化签名,在我让它工作之后,我可以重构以传递参数。
I am using C# and EF 4. I have a Actor repository. The entity Actor has many to many relationship with Movie.
So in the ActorReposity i'd like to have a method example GetActors whose salary is greater than 100 and also in the results i would like to include the movies that this actor has been in whose director is Doe.(director is property on the movie)
the signiture of the method i have in the repository is IQueryable GetActors(). In this case i am just simpifying the signiture, After i get this to work then i can refactor to pass in parameters.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)