/// <summary> /// Set /// </summary> /// <param name="column"></param> /// <param name="value"></param> /// <returns></returns> public IFrom <T> Set(string column, object value) { var field = TypeMapper.GetFieldName <T>(column); _set.AppendFormat("{0}{1} = @{2}", _set.Length == 0 ? "" : ",", column, TypeMapper.GetFieldName <T>(column)); Param.Add("@" + field, value); return(this); }
/// <summary> /// 更新指定字段 /// </summary> /// <param name="expression"></param> /// <param name="value"></param> /// <returns></returns> public IFrom <T> Set(Expression <Func <T, object> > expression, object value) { var column = WhererVisitor.GetColumnName <T>(expression.Body); var field = TypeMapper.GetFieldName <T>(column); _set.AppendFormat("{0}{1} = @{2}", _set.Length == 0 ? "" : ",", column, TypeMapper.GetFieldName <T>(column)); Param.Add("@" + field, value); return(this); }