You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
879 B

2 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. namespace SqlSugar
  4. {
  5. public class AopProvider
  6. {
  7. private AopProvider()
  8. {
  9. }
  10. public AopProvider(SqlSugarClient context)
  11. {
  12. this.Context = context;
  13. this.Context.Ado.IsEnableLogEvent = true;
  14. }
  15. private SqlSugarClient Context { get; set; }
  16. public Action<Exception> OnError { set { this.Context.Ado.ErrorEvent = value; } }
  17. public Action<string, SugarParameter[]> OnLogExecuting { set { this.Context.Ado.LogEventStarting = value; } }
  18. public Action<string, SugarParameter[]> OnLogExecuted { set { this.Context.Ado.LogEventCompleted = value; } }
  19. public Func<string, SugarParameter[], KeyValuePair<string, SugarParameter[]>> OnExecutingChangeSql { set { this.Context.Ado.ProcessingEventStartingSQL = value; } }
  20. }
  21. }