LinQ to Entities:Lambda表达式

时间:2009-03-28 12:26:40

标签: c# linq entity-framework

我想翻译这个


var db = new PracticeEntities();
var destinations = db.DestinationDetails.
          Where(dd => dd.Language.Lang == "en-US" &&
          dd.Destination.Client.Any(c => c.Email == "abc@yahoo.com"));

类似于:


var destinations =
    from destinations in db.DestinationDetails
       where detail.Language.Lang == "en-US" &&
             dd.Destination.Client.Any(db.Client

但是,我不知道如何。

谢谢!

1 个答案:

答案 0 :(得分:3)

var destinations = from dd in db.DestinationDetails
                   where dd.Language.Lang == "en-US" &&
                         dd.Destination.Client.Any(c => c.Email == "abc@yahoo.com");

dd之后的变量名from取代了原始版本中lambdas中的参数声明。