Beispiel #1
0
 /// <summary>
 ///     更新语句后处理(单个实体操作不引发)
 /// </summary>
 /// <param name="operatorType">操作类型</param>
 /// <param name="entity">其它参数</param>
 private Task OnEvent(DataOperatorType operatorType, TData entity)
 {
     if (!GlobalEvent)
     {
         return(Task.CompletedTask);
     }
     return(DataUpdateHandler.OnStatusChanged(DataBase.Name, Name, operatorType, EntityEventValueType.EntityJson, JsonConvert.SerializeObject(entity)));
 }
Beispiel #2
0
 /// <summary>
 ///     更新语句后处理(单个实体操作不引发)
 /// </summary>
 /// <param name="operatorType">操作类型</param>
 /// <param name="key">其它参数</param>
 private Task OnKeyEvent(DataOperatorType operatorType, object key)
 {
     if (!GlobalEvent)
     {
         return(Task.CompletedTask);
     }
     return(DataUpdateHandler.OnStatusChanged(DataBase.Name, Name, operatorType, EntityEventValueType.Key, key?.ToString()));
 }
Beispiel #3
0
        /// <summary>
        ///     更新语句后处理(单个实体操作不引发)
        /// </summary>
        private Task OnMulitUpdateEvent(DataOperatorType operatorType, string condition, DbParameter[] args)
        {
            if (!GlobalEvent)
            {
                return(Task.CompletedTask);
            }
            var queryCondition = new MulitCondition
            {
                Condition  = condition,
                Parameters = new ConditionParameter[args.Length]
            };

            for (int i = 0; i < args.Length; i++)
            {
                queryCondition.Parameters[i] = new ConditionParameter
                {
                    Name  = args[i].ParameterName,
                    Value = args[i].Value == DBNull.Value ? null : args[i].Value.ToString(),
                    Type  = args[i].DbType
                };
            }
            return(DataUpdateHandler.OnStatusChanged(DataBase.Name, Name, operatorType, EntityEventValueType.QueryCondition, JsonConvert.SerializeObject(queryCondition)));
        }