/// <summary> /// set 单个字段数据 /// </summary> /// <param name="func">格式: it => it.CreatedOn</param> /// <param name="newVal">新值</param> public static SetU <M> Set <M, F>(this SetU <M> set, Expression <Func <M, F> > propertyFunc, F newVal) where M : class { set.DC.Action = ActionEnum.Update; set.SetChangeHandle <M, F>(propertyFunc, newVal, OptionEnum.Set); return(set); }
/// <summary> /// set 单个字段变更 /// </summary> /// <param name="func">格式: it => it.LockedCount</param> /// <param name="modifyVal">变更值</param> /// <param name="change">+/-/...</param> public static SetU <M> Change <M, F>(this SetU <M> set, Expression <Func <M, F> > propertyFunc, F modifyVal, ChangeEnum change) where M : class { set.DC.Action = ActionEnum.Update; set.SetChangeHandle <M, F>(propertyFunc, modifyVal, set.DC.GetChangeOption(change)); return(set); }
/**************************************************************************************************************/ /// <summary> /// 请参阅: <see langword=".Where() & .And() & .Or() 使用 https://www.cnblogs.com/Meng-NET/"/> /// </summary> public static WhereU <M> Where <M>(this SetU <M> set, Expression <Func <M, bool> > compareFunc) where M : class { set.DC.Action = ActionEnum.Where; set.ST_WhereAndOr(compareFunc); return(new WhereU <M>(set.DC)); }
/// <summary> /// 过滤条件起点 -- 设置多个条件 /// </summary> public static WhereU <M> Where <M>(this SetU <M> set, object mWhere) where M : class { set.DC.Action = ActionEnum.Where; set.WhereDynamicHandle <M>(mWhere); return(new WhereU <M>(set.DC)); }
/**************************************************************************************************************/ /// <summary> /// 过滤条件起点 /// </summary> /// <param name="func">格式: it => it.AgentId == id2</param> public static WhereU <M> Where <M>(this SetU <M> set, Expression <Func <M, bool> > func) { set.DC.OP.WhereHandle(func, CrudTypeEnum.Update); return(new WhereU <M>(set.DC)); }
/// <summary> /// set 单个字段变更 /// </summary> /// <param name="func">格式: it => it.LockedCount</param> /// <param name="modifyVal">变更值</param> /// <param name="change">+/-/...</param> public static SetU <M> Change <M, F>(this SetU <M> set, Expression <Func <M, F> > func, F modifyVal, ChangeEnum change) { set.DC.OP.SetChangeHandle <M, F>(func, modifyVal, ActionEnum.Update, set.DC.SqlProvider.GetChangeOption(change)); return(set); }
/// <summary> /// set 单个字段数据 /// </summary> /// <param name="func">格式: it => it.CreatedOn</param> /// <param name="newVal">新值</param> public static SetU <M> Set <M, F>(this SetU <M> set, Expression <Func <M, F> > func, F newVal) { set.DC.OP.SetChangeHandle <M, F>(func, newVal, ActionEnum.Update, OptionEnum.Set); return(set); }