SqlSugar/Src/Asp.NetCore2/SqlSugar/Abstract/AopProvider/AopProvider.cs

32 lines
2.2 KiB
C#
Raw Normal View History

2017-09-20 13:57:46 +08:00
using System;
using System.Collections.Generic;
using System.Data;
2017-09-20 13:57:46 +08:00
using System.Linq;
using System.Text;
namespace SqlSugar
{
public class AopProvider
{
private AopProvider() { }
2019-05-17 22:26:30 +08:00
public AopProvider(SqlSugarProvider context)
2017-09-20 13:57:46 +08:00
{
this.Context = context;
this.Context.Ado.IsEnableLogEvent = true;
}
2019-05-17 22:26:30 +08:00
private SqlSugarProvider Context { get; set; }
public Action<DiffLogModel> OnDiffLogEvent { set { this.Context.CurrentConnectionConfig.AopEvents.OnDiffLogEvent = value; } }
public Action<SqlSugarException> OnError { set { this.Context.CurrentConnectionConfig.AopEvents.OnError = value; } }
public Action<string, SugarParameter[]> OnLogExecuting { set { this.Context.CurrentConnectionConfig.AopEvents.OnLogExecuting= value; } }
public Action<string, SugarParameter[]> OnLogExecuted { set { this.Context.CurrentConnectionConfig.AopEvents.OnLogExecuted = value; } }
public Func<string, SugarParameter[], KeyValuePair<string, SugarParameter[]>> OnExecutingChangeSql { set { this.Context.CurrentConnectionConfig.AopEvents.OnExecutingChangeSql = value; } }
2021-08-01 17:17:09 +08:00
public virtual Action<object, DataFilterModel> DataExecuting { set { this.Context.CurrentConnectionConfig.AopEvents.DataExecuting = value; } }
2024-06-21 12:54:03 +08:00
public Action<object, DataFilterModel> DataChangesExecuted { set { this.Context.CurrentConnectionConfig.AopEvents.DataChangesExecuted = value; } }
2022-08-10 15:09:42 +08:00
public virtual Action<object, DataAfterModel> DataExecuted { set { this.Context.CurrentConnectionConfig.AopEvents.DataExecuted = value; } }
public Action<IDbConnection> CheckConnectionExecuting { set { this.Context.CurrentConnectionConfig.AopEvents.CheckConnectionExecuting = value; } }
public Action<IDbConnection, TimeSpan> CheckConnectionExecuted { set { this.Context.CurrentConnectionConfig.AopEvents.CheckConnectionExecuted = value; } }
public Action<string, SugarParameter[]> OnGetDataReadering { set { this.Context.CurrentConnectionConfig.AopEvents.OnGetDataReadering = value; } }
public Action<string, SugarParameter[], TimeSpan> OnGetDataReadered { set { this.Context.CurrentConnectionConfig.AopEvents.OnGetDataReadered = value; } }
2017-09-20 13:57:46 +08:00
}
}