public async Task Invoke(HttpContext context) { WebSecurityUtil.Authenticate(context, service); WebSecurityUtil.OpenScope(context); await next(context); WebSecurityUtil.CloseScope(context); }
public async Task Invoke(HttpContext context) { DbContext.CreateContext(Settings.ConnectionString); WebSecurityUtil.Authenticate(context); WebSecurityUtil.OpenScope(context); await next(context); WebSecurityUtil.CloseScope(context); DbContext.CloseContext(); }