示例#1
0
        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
 private TenantViewModel ToViewModel(Tenant tenant)
 {
     return(tenant.Map <TenantViewModel>(afterMap: afterMap =>
     {
         afterMap.LoginUri = $"{RouteBindingLogic.GetBaseUri().Trim('/')}/{tenant.Name}".ToLower();
     }));
 }
示例#3
0
 private void ShowTenant(string tenantName)
 {
     tenantInfo.Name         = tenantName;
     tenantInfo.LoginUri     = $"{RouteBindingLogic.GetBaseUri().Trim('/')}/{tenantName}".ToLower();
     deleteTenantError       = null;
     deleteTenantAcknowledge = false;
     tenantModal.Show();
 }