随笔分类 - .NET Framework
MyDAL - .UpdateAsync() 之 .SetSegment 根据条件 动态设置 要更新的字段 使用
摘要:索引: 目录索引 一.API 列表 1.SetSegment 属性,指示 根据条件 动态拼接 要修改的字段 见如下示例. 二.API 单表-完整 方法 举例 以 MySQL 为例,生成 SQL 如下: 蒙 2019-04-13 23:59 周六
阅读全文
MyDAL - .UpdateAsync() 之 .Set() 使用
摘要:索引: 目录索引 一.API 列表 1.Set<M, F>(Expression<Func<M, F>> propertyFunc, F newVal) 如: .Set(it => it.BodyMeasureProperty, "{xxx:yyy,mmm:nnn,zzz:aaa}") 用于 单表
阅读全文
MyDAL - 引用类型对象 .DeepClone() 深度克隆[深度复制] 工具 使用
摘要:索引: 目录索引 一.API 列表 .DeepClone() 用于 Model / Entity / ... ... 等引用类型对象的深度克隆 特性说明 1.不需要对对象做任何特殊处理,直接 .DeepClone() 即可得到该对象的深度克隆 2.不受对象层次深度限制,均可实现深度克隆(下面会给出几
阅读全文
MyDAL - in && not in 条件 使用
摘要:索引: 目录索引 一.API 列表 C# 代码中 接口 IList.Contains() 方法生成 SQL 对应的 in(val1,val2,... ...) 如:.Queryer<Agent>() ... ... .Where(it => new AgentLevel?[] { AgentLeve
阅读全文
MyDAL - like && not like 条件 使用
摘要:索引: 目录索引 一.API 列表 C# 代码中 String.Contains("conditionStr") 生成 SQL 对应的 like '%conditionStr%' 如:.Queryer<Agent>() ... ... .Where(it => it.PathId.Contains(
阅读全文
MyDAL - is null && is not null 条件 使用
摘要:索引: 目录索引 一.API 列表 C# 代码中 instance.property == null 生成 SQL 对应的 is null : 如:.Queryer<Agent>() ... ... .Where(it => it.CrmUserId == null) ... ... 用于 单表 i
阅读全文
MyDAL - .QueryListAsync() 使用
摘要:索引: 目录索引 一.API 列表 .QueryListAsync() .QueryListAsync<M>() 如: .QueryListAsync<AgentInventoryRecord>() , 用于 单表/多表连接 查询. .QueryListAsync<VM>() 如: .QueryLi
阅读全文
MyDAL - .Where() & .And() & .Or() 使用
摘要:索引: 目录索引 一.API 列表 1.Where .Where(Func<M, bool> func) 如: .Where( it => (it.Prop1>=条件1 && it.Prop2<=条件2) || it.Prop3==条件3 ) 此类写法, 用在 Deleter/Updater/Que
阅读全文
浙公网安备 33010602011771号