我该如何使用LLBL GenPro编写一些代码:
var myString = "Blah,Blah,Blah,Blah";
DbContext.MyTableName.Where(a => myString.Contains(a.TableFiledName.ToString()))
它是带有实体的lambda表达式,但是现在我想在LLBL Genpro中做同样的事情,我该怎么做?
请帮助 谢谢
答案 0 :(得分:0)
假设您所指的是LLBLGen Framework(LLBLGen设计器supports generating code for multiple O/RM Framerowks),这就是using QuerySpec的样子:
var myString = "Blah,Blah,Blah,Blah";
var qf = new QueryFactory();
var q = qf.Customer.Where(CustomerFields.Country.Contains(myString));
或者非常相似,使用Linq2LLBL:
var myString = "Blah,Blah,Blah,Blah";
var metaData = new LinqMetaData(adapter);
var q = from c in metaData.Customer where c.Country.Contains(myString);