public void CopyTo(ref tenant tenant) { foreach (var propertyInfo in tenant.GetType().GetProperties()) { if (!propertyInfo.Name.Contains("Id") && (propertyInfo.PropertyType.IsValueType || propertyInfo.PropertyType.Name == "String")) { propertyInfo.SetValue(tenant, propertyInfo.GetValue(this)); } } }
public NewTenantModel(tenant tenant) { foreach (var propertyInfo in tenant.GetType().GetProperties()) { if (propertyInfo.PropertyType.IsValueType || propertyInfo.PropertyType.Name == "String") { propertyInfo.SetValue(this, propertyInfo.GetValue(tenant)); } } Email = tenant.user.Email; Password = tenant.user.Password; Deleted = tenant.user.Deleted; }