public async Task Invoke(HttpContext httpContext, GlobalDbContext dbContext) { var tenantGuid = httpContext.Request.Headers["X-Tenant-Guid"].FirstOrDefault(); if (!string.IsNullOrEmpty(tenantGuid)) { var tenant = dbContext.Tenants.FirstOrDefault(t => t.Guid.ToString() == tenantGuid); httpContext.Items["TENANT"] = tenant; } await _next.Invoke(httpContext); }
public DbSeeder(GlobalDbContext context) { _context = context; }