摘要: 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. 阅读全文
posted @ 2011-05-18 15:02 jejexu 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 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 / 阅读全文
posted @ 2011-05-18 15:01 jejexu 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 1 数据连接并实例LightSpeedContext对象 2 public static readonly LightSpeedContext<LinghtSpeedModelUnitOfWork> context = 3 new LightSpeedContext<LinghtSpeedModelUnitOfWork>() 4 { 5 //连接字符串 6 ConnectionString = ConfigurationManager.ConnectionStrings["RetailSqlServer2005"].ToString(), 7 //使 阅读全文
posted @ 2011-05-18 14:59 jejexu 阅读(206) 评论(0) 推荐(0) 编辑