示例#1
0
        private Tenant ToTenant(object[] r)
        {
            var tenant = new Tenant(Convert.ToInt32(r[0]), (string)r[1])
            {
                MappedDomain = (string)r[2],
                Version = Convert.ToInt32(r[3]),
                Name = (string)r[4],
                Language = (string)r[5],
                TimeZone = GetTimeZone((string)r[6]),
                OwnerId = r[7] != null ? new Guid((string)r[7]) : Guid.Empty,
                TrustedDomainsType = (TenantTrustedDomainsType)Convert.ToInt32(r[9]),
                CreatedDateTime = (DateTime)r[10],
                Status = (TenantStatus)Convert.ToInt32(r[11]),
                StatusChangeDate = r[12] != null ? (DateTime)r[12] : default(DateTime),
                LastModified = (DateTime)r[13],
            };
            tenant.SetTrustedDomains((string)r[8]);
            CalculateTenantDomain(tenant);

            return tenant;
        }
        private Tenant ToTenant(object[] r)
        {
            var tenant = new Tenant(Convert.ToInt32(r[0]), (string)r[1])
            {
                MappedDomain = (string)r[2],
                Version = Convert.ToInt32(r[3]),
                VersionChanged = Convert.ToDateTime(r[4]),
                Name = (string)r[5],
                Language = (string)r[6],
                TimeZone = GetTimeZone((string)r[7]),
                OwnerId = r[8] != null ? new Guid((string)r[8]) : Guid.Empty,
                TrustedDomainsType = (TenantTrustedDomainsType)Convert.ToInt32(r[10]),
                CreatedDateTime = (DateTime)r[11],
                Status = (TenantStatus)Convert.ToInt32(r[12]),
                StatusChangeDate = r[13] != null ? (DateTime)r[13] : default(DateTime),
                PaymentId = (string)r[14],
                LastModified = (DateTime)r[15],
                PartnerId = (string)r[16],
                Industry = r[17] != null ? (TenantIndustry)Convert.ToInt32(r[17]) : TenantIndustry.Other
            };
            tenant.SetTrustedDomains((string)r[9]);

            return tenant;
        }