Skip to content

@Ahoo-Wang Ahoo-Wang released this Jul 17, 2019 · 146 commits to master since this release

  1. refactor FormatSql
  2. refactor Middleware
  3. add support IFilter
SmartSqlBuilder = new SmartSqlBuilder()
                .UseXmlConfig()
                .UseLoggerFactory(LoggerFactory)
                .UseAlias(GLOBAL_SMART_SQL)
                .AddFilter<TestPrepareStatementFilter>()
                .Build();
public class TestPrepareStatementFilter : IPrepareStatementFilter, ISetupSmartSql
    {
        private ILogger<TestPrepareStatementFilter> _logger;

        public void OnInvoking(ExecutionContext context)
        {
            _logger.LogDebug("TestPrepareStatementFilter.OnInvoking");
        }

        public void OnInvoked(ExecutionContext context)
        {
            _logger.LogDebug("TestPrepareStatementFilter.OnInvoked");
        }

        public Task OnInvokingAsync(ExecutionContext context)
        {
            _logger.LogDebug("TestPrepareStatementFilter.OnInvokingAsync");
            return Task.CompletedTask;
        }

        public Task OnInvokedAsync(ExecutionContext context)
        {
            _logger.LogDebug("TestPrepareStatementFilter.OnInvokedAsync");
            return Task.CompletedTask;
        }

        public void SetupSmartSql(SmartSqlBuilder smartSqlBuilder)
        {
            _logger = smartSqlBuilder.LoggerFactory.CreateLogger<TestPrepareStatementFilter>();
        }
    }
Assets 2
You can’t perform that action at this time.