예제 #1
0
파일: MainLayout.cs 프로젝트: lulzzz/FoxIDs
        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;
                }
            }
        }
예제 #2
0
 public async Task <ActionResult <TenantConfig> > Create([FromBody] CreateTenant createTenant)
 {
     return(await _tenantService.CreateTenantAsync(createTenant));
 }