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();
        }
예제 #2
0
        public async Task <TenantSettingsDTO> Get()
        {
            var tenantId = await _currentTenantProvider.GetTenantIdAsync(User);

            return(await _tenantSettingsService.GetByTenantIdAsync(tenantId));
        }
예제 #3
0
        //[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));
        }