包含子查询详细信息CTP codefirst [英] Include subquery details CTP codefirst

查看:57
本文介绍了包含子查询详细信息CTP codefirst的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下查询(看起来)做我想要的事情

I have the following query which (appears) to do what I want


        var races = from r in db.Races.Include("Sponsor").Include("Location").Include("Results").Include("Director")
              join rst in db.Results.Include("Member")
              on r.RACEID equals rst.RaceID
              where (r.rDate <= lastDate && r.rDate >= earlyDate)
              orderby r.rDate descending 
              select r;

推荐答案

我认为您的问题是" ;有没有办法在没有连接的情况下包含Results.Member?"

I think your question is "is there a way to include Results.Member without doing the join?"

如果是,那么答案是肯定的,您可以使用.Include(" Results.Member")而不是不仅仅是。包括("结果")。

If so then the answer is yes, you can use .Include("Results.Member") rather than just .Include("Results").

〜罗文


这篇关于包含子查询详细信息CTP codefirst的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆