Exemplo n.º 1
0
        public async Task <ActionResult <IList <Module> > > GetAll(Guid projectId)
        {
            var tenant = (await _tenantService.GetTenantFromHostAsync());

            if (tenant != null)
            {
                Console.WriteLine($"getting modules for {tenant.Id} : {tenant.Name}");
                using (var context = _tenantService.CreateContext(tenant))
                {
                    var moduleService = new ModuleService(context);
                    return(Ok(await moduleService.GetAllModulesAsync(projectId)));
                }
            }

            return(BadRequest("Tenant doesn't exist"));
        }