/// <summary> /// 更新数据 /// </summary> /// <typeparam name="valueType">数据类型</typeparam> /// <typeparam name="modelType">模型类型</typeparam> /// <param name="sqlTool">SQL操作工具</param> /// <param name="transaction">事务操作</param> /// <param name="value">匹配成员值</param> /// <param name="memberMap">成员位图</param> /// <param name="query">查询信息</param> /// <returns>更新是否成功</returns> internal abstract bool Update <valueType, modelType> (Sql.Table <valueType, modelType> sqlTool, Transaction transaction, valueType value, MemberMap <modelType> memberMap, ref UpdateQuery <modelType> query) where valueType : class, modelType where modelType : class;
/// <summary> /// 更新数据 /// </summary> /// <typeparam name="valueType">数据类型</typeparam> /// <typeparam name="modelType">模型类型</typeparam> /// <param name="sqlTool">SQL操作工具</param> /// <param name="connection">SQL连接</param> /// <param name="value">匹配成员值</param> /// <param name="memberMap">成员位图</param> /// <param name="query">查询信息</param> /// <param name="isIgnoreTransaction">是否忽略应用程序事务</param> /// <returns>更新是否成功</returns> internal bool Update <valueType, modelType> (Sql.Table <valueType, modelType> sqlTool, ref DbConnection connection, valueType value, MemberMap <modelType> memberMap, ref UpdateQuery <modelType> query, bool isIgnoreTransaction) where valueType : class, modelType where modelType : class { if (sqlTool.CallOnUpdate(value, memberMap)) { if (isIgnoreTransaction) { return(Update(sqlTool, ref connection, value, memberMap, ref query)); } if (AutoCSer.DomainUnload.Unloader.TransactionStart(false)) { try { return(Update(sqlTool, ref connection, value, memberMap, ref query)); } finally { AutoCSer.DomainUnload.Unloader.TransactionEnd(); } } } return(false); }