Example #1
0
        public valueType Update(int identity, ref fastCSharp.emit.sqlTable.updateExpression updateExpression, bool isIgnoreTransaction = false)
        {
            valueType cacheLock = this[identity];

            if (cacheLock != null && updateExpression.Count != 0)
            {
                valueType value = fastCSharp.emit.constructor <valueType> .New();

                fastCSharp.emit.sqlModel <modelType> .SetIdentity(value, identity);

                if (SqlTool.Client.UpdateByIdentity(SqlTool, value, ref updateExpression, cacheLock, isIgnoreTransaction))
                {
                    return(value);
                }
            }
            return(null);
        }
Example #2
0
 public valueType Update(int identity, fastCSharp.emit.sqlTable.updateExpression updateExpression, bool isIgnoreTransaction = false)
 {
     return(Update(identity, ref updateExpression, isIgnoreTransaction));
 }
Example #3
0
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <typeparam name="valueType">数据类型</typeparam>
 /// <typeparam name="modelType">模型类型</typeparam>
 /// <param name="sqlTool">SQL操作工具</param>
 /// <param name="value">待更新数据自增id标识</param>
 /// <param name="updateExpression">待更新数据</param>
 /// <param name="isIgnoreTransaction">是否忽略应用程序事务</param>
 /// <param name="onUpdated"></param>
 public override void UpdateByIdentity <valueType, modelType>(fastCSharp.emit.sqlTable.sqlTool <valueType, modelType> sqlTool, valueType value
                                                              , ref fastCSharp.emit.sqlTable.updateExpression updateExpression, bool isIgnoreTransaction, Action <valueType, valueType, fastCSharp.code.memberMap> onUpdated)
 {
     onUpdated(null, null, null);
     log.Error.Throw(log.exceptionType.ErrorOperation);
 }
Example #4
0
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <typeparam name="valueType">数据类型</typeparam>
 /// <typeparam name="modelType">模型类型</typeparam>
 /// <param name="sqlTool">SQL操作工具</param>
 /// <param name="value">待更新数据自增id标识</param>
 /// <param name="sqlExpression">待更新数据</param>
 /// <param name="memberMap">目标成员位图</param>
 /// <returns>更新前的数据对象,null表示失败</returns>
 protected override valueType updateByIdentity <valueType, modelType>(fastCSharp.emit.sqlTable.sqlTool <valueType, modelType> sqlTool
                                                                      , valueType value, ref fastCSharp.emit.sqlTable.updateExpression sqlExpression, fastCSharp.code.memberMap <modelType> memberMap)
 {
     log.Error.Throw(log.exceptionType.ErrorOperation);
     return(null);
 }