Beispiel #1
0
        private Task CreateTenant(Guid wellKnownGuid, string clientName, string?parentId = null)
        {
            ITenantStore service = ContainerBindings.GetServiceProvider(this.scenarioContext).GetRequiredService <ITenantStore>();

            return(CatchException.AndStoreInScenarioContextAsync(
                       this.scenarioContext,
                       async() =>
            {
                ITenant newTenant = await service.CreateClientTenantWithWellKnownGuidAsync(wellKnownGuid, clientName, parentId).ConfigureAwait(false);
                this.scenarioContext.Set(newTenant.Id, clientName);
            }));
        }
 /// <summary>
 /// Creates a new tenant representing a client.
 /// </summary>
 /// <param name="tenantStore">The <see cref="ITenantStore"/>.</param>
 /// <param name="clientName">The name of the new tenant.</param>
 /// <param name="parentId">Optional ID of parent Client tenant.</param>
 /// <param name="wellKnownGuid">Optional well-known GUID to use as the client ID for the new tenant.</param>
 /// <returns>The new tenant.</returns>
 public static Task <ITenant> CreateClientTenantAsync(
     this ITenantStore tenantStore,
     string clientName,
     string?parentId    = null,
     Guid?wellKnownGuid = null) => tenantStore.CreateClientTenantWithWellKnownGuidAsync(wellKnownGuid ?? Guid.NewGuid(), clientName, parentId);