public virtual void RemoveEuTravelDiaryPhotographDTO(EuTravelDiaryPhotographDTO __item) { if (__item != null && euTravelDiaryPhotographDTO != null && euTravelDiaryPhotographDTO.Contains(__item)) { euTravelDiaryPhotographDTO.Remove(__item); __item.EuTravelDiaryPOIDTO = null; } }
public virtual void AddEuTravelDiaryPhotographDTO(EuTravelDiaryPhotographDTO __item) { if (__item != null && euTravelDiaryPhotographDTO != null && !euTravelDiaryPhotographDTO.Contains(__item)) { euTravelDiaryPhotographDTO.Add(__item); if (__item.EuTravelDiaryPOIDTO != this) { __item.EuTravelDiaryPOIDTO = this; } } }
public virtual void SetEuTravelDiaryPhotographDTOAt(EuTravelDiaryPhotographDTO __item, int __index) { if (__item == null) { euTravelDiaryPhotographDTO[__index].EuTravelDiaryPOIDTO = null; } else { euTravelDiaryPhotographDTO[__index] = __item; if (__item.EuTravelDiaryPOIDTO != this) { __item.EuTravelDiaryPOIDTO = this; } } }
/// <summary> /// Returns true if self and the provided entity have the same Id values /// and the Ids are not of the default Id value /// </summary> protected bool HasSameNonDefaultIdAs(EuTravelDiaryPhotographDTO compareTo) { return(!this.IsTransient() && !compareTo.IsTransient() && this.EuTravelDiaryPhotographDTOKey.Equals(compareTo.EuTravelDiaryPhotographDTOKey)); }
/// <summary> /// Copies the current object to a new instance /// </summary> /// <param name="deep">Copy members that refer to objects external to this class (not dependent)</param> /// <param name="copiedObjects">Objects that should be reused</param> /// <param name="asNew">Copy the current object as a new one, ready to be persisted, along all its members.</param> /// <param name="reuseNestedObjects">If asNew is true, this flag if set, forces the reuse of all external objects.</param> /// <param name="copy">Optional - An existing [EuTravelDiaryPhotographDTO] instance to use as the destination.</param> /// <returns>A copy of the object</returns> public virtual EuTravelDiaryPhotographDTO Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, EuTravelDiaryPhotographDTO copy = null) { if (copiedObjects == null) { copiedObjects = new Hashtable(); } if (copy == null && copiedObjects.Contains(this)) { return((EuTravelDiaryPhotographDTO)copiedObjects[this]); } copy = copy ?? new EuTravelDiaryPhotographDTO(); if (!asNew) { copy.TransientId = this.TransientId; copy.EuTravelDiaryPhotographDTOKey = this.EuTravelDiaryPhotographDTOKey; } copy.Name = this.Name; copy.Description = this.Description; copy.IsPublic = this.IsPublic; copy.File = this.File; copy.Id = this.Id; if (!copiedObjects.Contains(this)) { copiedObjects.Add(this, copy); } if (deep && this.geoCoordinatesDTO != null) { if (!copiedObjects.Contains(this.geoCoordinatesDTO)) { if (asNew && reuseNestedObjects) { copy.GeoCoordinatesDTO = this.GeoCoordinatesDTO; } else if (asNew) { copy.GeoCoordinatesDTO = this.GeoCoordinatesDTO.Copy(deep, copiedObjects, true); } else { copy.geoCoordinatesDTO = this.geoCoordinatesDTO.Copy(deep, copiedObjects, false); } } else { if (asNew) { copy.GeoCoordinatesDTO = (EuTravelDiaryGeoCoordinatesDTO)copiedObjects[this.GeoCoordinatesDTO]; } else { copy.geoCoordinatesDTO = (EuTravelDiaryGeoCoordinatesDTO)copiedObjects[this.GeoCoordinatesDTO]; } } } if (deep && this.takenBy != null) { if (!copiedObjects.Contains(this.takenBy)) { if (asNew && reuseNestedObjects) { copy.TakenBy = this.TakenBy; } else if (asNew) { copy.TakenBy = this.TakenBy.Copy(deep, copiedObjects, true); } else { copy.takenBy = this.takenBy.Copy(deep, copiedObjects, false); } } else { if (asNew) { copy.TakenBy = (EuTravelDiaryPersonDTO)copiedObjects[this.TakenBy]; } else { copy.takenBy = (EuTravelDiaryPersonDTO)copiedObjects[this.TakenBy]; } } } if (deep && this.euTravelDiaryPOIDTO != null) { if (!copiedObjects.Contains(this.euTravelDiaryPOIDTO)) { if (asNew && reuseNestedObjects) { copy.EuTravelDiaryPOIDTO = this.EuTravelDiaryPOIDTO; } else if (asNew) { copy.EuTravelDiaryPOIDTO = this.EuTravelDiaryPOIDTO.Copy(deep, copiedObjects, true); } else { copy.euTravelDiaryPOIDTO = this.euTravelDiaryPOIDTO.Copy(deep, copiedObjects, false); } } else { if (asNew) { copy.EuTravelDiaryPOIDTO = (EuTravelDiaryPOIDTO)copiedObjects[this.EuTravelDiaryPOIDTO]; } else { copy.euTravelDiaryPOIDTO = (EuTravelDiaryPOIDTO)copiedObjects[this.EuTravelDiaryPOIDTO]; } } } return(copy); }