2009-01-26 38 views
0

有什么方法可以在查询中设置Linq to SQL设计器(不是数据库中的列)生成的属性吗?将Linq中的非列属性值设置为SQL查询

例如是否有类似的someMethod(这种方法):

IQuaryable<T> query = (from t in context.MyTable 
         where {some conditions} 
         select t).SomeMethod("MyPropertyName", value); 

回答

0

var query = (from t in context.MyTable 
        where {some conditions} 
        select new {t, MyPropertyName = value }); 

林不知道这是否是你问或不是。