public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) { var user = (context.Controller as ControllerBase).User; foreach (var model in context.ActionArguments.Values.Select(v => v as IModelWithTenantId).Where(v => v != null)) { model.TenantId = await _currentTenantProvider.GetTenantIdAsync(user); } await next(); }
public async Task <TenantSettingsDTO> Get() { var tenantId = await _currentTenantProvider.GetTenantIdAsync(User); return(await _tenantSettingsService.GetByTenantIdAsync(tenantId)); }
//[CompanyAdministrator] public async Task <IEnumerable <OrgUnitResponseDTO> > GetAll() { var tenantId = await _currentTenantProvider.GetTenantIdAsync(User); return(await _orgUnitsService.GetAllAsync(tenantId)); }
public async Task <IEnumerable <EmployeeDTO> > GetAll() { var tenantId = await _currentTenantProvider.GetTenantIdAsync(User); return(await _employeesService.GetAllAsync(tenantId)); }