Beispiel #1
0
 public TenantHandle[] CreateTenants(string prefix, int count)
 {
     TenantHandle[] handles = new TenantHandle[count];
     for (int i = 1; i <= count; i++)
     {
         handles[i - 1] = CreateTenantInternal(String.Format("{0}{1}", prefix, i));
     }
     return(handles);
 }
Beispiel #2
0
        public void BeginTransaction(TenantHandle tenant = default(TenantHandle))
        {
            if (tenant == default(TenantHandle))
            {
                tenant = DefaultTenant;
            }
            if (DefaultTenant == TenantHandle.Empty)
            {
                throw new InvalidOperationException("please specify a tenant on which to begin a transaction");
            }

            if (CurrentTransaction != null)
            {
                throw new InvalidOperationException("please commit or discard the current transaction before beginning a new one");
            }

            CurrentTransaction = new Transaction(DefaultTenant);
        }
Beispiel #3
0
 public string GetTenantName(TenantHandle handle)
 {
     return(GetTenantNameInternal(handle));
 }
Beispiel #4
0
 protected abstract string GetTenantNameInternal(TenantHandle handle);
Beispiel #5
0
 public Transaction(TenantHandle tenant)
 {
     Tenant = tenant;
 }