private async Task OnCreateTenantValidSubmitAsync(EditContext editContext) { try { await TenantService.CreateTenantAsync(createTenantForm.Model.Map <CreateTenantRequest>(afterMap => { afterMap.ControlClientBaseUri = RouteBindingLogic.GetBaseUri(); })); createTenantDone = true; createTenantReceipt.Add("Tenant created."); createTenantReceipt.Add("Master track with user repository created."); createTenantReceipt.Add("Master track default login up-party created."); createTenantReceipt.Add("First master track administrator user created."); createTenantReceipt.Add("Master track FoxIDs Control API down-party created."); createTenantReceipt.Add("Master track FoxIDs Control client down-party created."); createTenantReceipt.Add("Test track with user repository created."); createTenantReceipt.Add("Production track with user repository created."); await NotificationLogic.TenantUpdatedAsync(); } catch (FoxIDsApiException ex) { if (ex.StatusCode == System.Net.HttpStatusCode.Conflict) { createTenantForm.SetFieldError(nameof(createTenantForm.Model.Name), ex.Message); } else { throw; } } }
public async Task <ActionResult <TenantConfig> > Create([FromBody] CreateTenant createTenant) { return(await _tenantService.CreateTenantAsync(createTenant)); }