Exemplo n.º 1
0
 /// <summary>
 /// Checks that the specified tenant is one of the allowable types and throws a
 /// <see cref="InvalidMarainTenantTypeException"/> if it is not.
 /// </summary>
 /// <param name="tenant">The tenant to check.</param>
 /// <param name="allowableTenantTypes">The list of allowable types for the tenant.</param>
 /// <exception cref="InvalidMarainTenantTypeException">The type is not one of the specified types.</exception>
 public static void EnsureTenantIsOfType(this ITenant tenant, params MarainTenantType[] allowableTenantTypes)
 {
     if (!tenant.IsTenantOfType(allowableTenantTypes))
     {
         throw new InvalidMarainTenantTypeException(tenant.Id, tenant.GetMarainTenantType(), allowableTenantTypes);
     }
 }