摘要:
查询的最后一篇排序 var z = new SelectSqlSection<RJ.DModel.Users>(); z.OrderBy(a => a.D_Id);SELECT * FROM [Users] ORDER BY [Users].[D_Id]var z = new SelectSqlSection<RJ.DModel.Users>(); z.OrderBy(a => new { a.D_Id ,a.U_Id.Desc});SELECT * FROM [Users] ORDER BY [Users].[D_Id],[Users].[U_Id] DE 阅读全文
摘要:
虽然没人看不过还是继续写上一篇写的是直接传SQL语句的方法 在C#代码中看到SQL怎么都觉得不舒服好了现在看下C#的写法var z = new SelectSqlSection<RJ.DModel.Users>();z.AddColumn(a => new { s = (a.D_Id * 5), b = a.U_UserName }); db.ToIList<RJ.Model.Users>(z)生成的SQL语句如下SELECT ([Users].[D_Id] * @pj02gde4ln6dfwj) [s],[Users].[U_UserName] [b] FROM 阅读全文