public static Building GetEntity(this BuildingPrimitive primitive) { Building result = new Building(); result.Id = primitive.Id; result.InternalName = primitive.InternalName; result.ZIPCode = primitive.ZIPCode; result.City = primitive.City; result.Street = primitive.Street; result.Phone = primitive.Phone; result.ContactPerson = primitive.ContactPerson; result.ContactPersonPhone = primitive.ContactPersonPhone; result.HouseNo = primitive.HouseNo; result.Deleted = primitive.Deleted; result.Deactivated = primitive.Deactivated; result.Name = primitive.Name; return result; }
private void FixupBuilding(Building previousValue) { if (previousValue != null && previousValue.ClientBuildings.Contains(this)) { previousValue.ClientBuildings.Remove(this); } if (Building != null) { if (!Building.ClientBuildings.Contains(this)) { Building.ClientBuildings.Add(this); } if (Building_Id != Building.Id) { Building_Id = Building.Id; } } else if (!_settingFK) { Building_Id = null; } }