/// <summary> /// 设置查询列和分页参数执行查询,并且将结果集转成dynamic /// </summary> /// <param name="sqlable"></param> /// <param name="fileds">查询列</param> /// <param name="orderByFiled">Order By字段,可以多个</param> /// <param name="pageIndex">页码</param> /// <param name="pageSize">每页显示数量</param> /// <param name="whereObj">SQL参数,例如:new{id=1,name="张三"}</param> /// <returns></returns> public static dynamic SelectToPageDynamic(this Sqlable sqlable, string fileds, string orderByFiled, int pageIndex, int pageSize, object whereObj = null) { return(JsonConverter.ConvertJson(SelectToPageJson(sqlable, fileds, orderByFiled, pageIndex, pageSize, whereObj))); }
/// <summary> /// 将Queryable转换为Dynamic /// </summary> /// <typeparam name="T">实体类型</typeparam> /// <param name="queryable">查询对象</param> /// <returns>dynamic</returns> public static dynamic ToDynamic <T>(this Queryable <T> queryable) { return(JsonConverter.ConvertJson(ToJson <T>(queryable))); }
/// <summary> /// 设置查询列执行查询,并且将结果集转成dynamic /// </summary> /// <param name="sqlable"></param> /// <param name="fileds">查询列</param> /// <param name="whereObj">SQL参数,例如:new{id=1,name="张三"}</param> /// <returns></returns> public static dynamic SelectToDynamic(this Sqlable sqlable, string fileds, object whereObj = null) { return(JsonConverter.ConvertJson(SelectToJson(sqlable, fileds, whereObj))); }