摘要:
1 分页 2 // skip 3 results then take 10 3 4 var query1 = new Query {Page = Page.At(3, 10)}; 5 6 // get the first 10 results 7 8 var query2 = new Query {Page = Page.Limit(10)}; 9 10 // skip 20 results11 12 var query3 = new Query {Page = Page.Offset(20)};13 14 //Offset=startRowIndex当前页码Limit=maximumRow. 阅读全文
摘要:
1 LightSpeed中使用子表达式 2 3 Query query = new Query(); 4 //创建一个求和的子表达式 5 query.Subexpressions.Add("TotalCost", 6 Entity.Attribute("AllowAdd").Function("SUM"), 7 "Id"); 8 query.Projection.Add(Entity.Attribute("AllowExport").Function("Sun")); 9 / 阅读全文
摘要:
1 数据连接并实例LightSpeedContext对象 2 public static readonly LightSpeedContext<LinghtSpeedModelUnitOfWork> context = 3 new LightSpeedContext<LinghtSpeedModelUnitOfWork>() 4 { 5 //连接字符串 6 ConnectionString = ConfigurationManager.ConnectionStrings["RetailSqlServer2005"].ToString(), 7 //使 阅读全文