/// <summary>
        ///     Sets the context to the specified tenant.
        ///     This context is not compatible with the legacy resource model.
        /// </summary>
        /// <param name="tenantName">The tenant name.</param>
        /// <remarks></remarks>
        public static void SetTenantAdministratorContext(string tenantName)
        {
            RequestContext.SetSystemAdministratorContext();
            var tenant = TenantHelper.Find(tenantName);

            RequestContext.SetTenantAdministratorContext(tenant.Id);
        }
Beispiel #2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="TenantAdministratorContext" /> class.
 /// </summary>
 /// <param name="tenantName">Name of the tenant.</param>
 public TenantAdministratorContext(string tenantName)
     : base(() => RequestContext.SetTenantAdministratorContext(GetTenantId(tenantName)))
 {
 }
Beispiel #3
0
 /// <summary>
 ///     Default constructor for the TenantAdministratorContext object.
 /// </summary>
 /// <param name="tenantEntityId">The tenant entity id.</param>
 /// <remarks></remarks>
 public TenantAdministratorContext(long tenantEntityId)
     : base(() => RequestContext.SetTenantAdministratorContext(tenantEntityId))
 {
 }