public virtual void RemoveEuTravelDiaryNoteDTO(EuTravelDiaryNoteDTO __item) { if (__item != null && euTravelDiaryNoteDTO != null && euTravelDiaryNoteDTO.Contains(__item)) { euTravelDiaryNoteDTO.Remove(__item); __item.EuTravelDiaryPOIDTO = null; } }
public virtual void AddEuTravelDiaryNoteDTO(EuTravelDiaryNoteDTO __item) { if (__item != null && euTravelDiaryNoteDTO != null && !euTravelDiaryNoteDTO.Contains(__item)) { euTravelDiaryNoteDTO.Add(__item); if (__item.EuTravelDiaryPOIDTO != this) { __item.EuTravelDiaryPOIDTO = this; } } }
public virtual void SetEuTravelDiaryNoteDTOAt(EuTravelDiaryNoteDTO __item, int __index) { if (__item == null) { euTravelDiaryNoteDTO[__index].EuTravelDiaryPOIDTO = null; } else { euTravelDiaryNoteDTO[__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(EuTravelDiaryNoteDTO compareTo) { return(!this.IsTransient() && !compareTo.IsTransient() && this.EuTravelDiaryNoteDTOKey.Equals(compareTo.EuTravelDiaryNoteDTOKey)); }
/// <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 [EuTravelDiaryNoteDTO] instance to use as the destination.</param> /// <returns>A copy of the object</returns> public virtual EuTravelDiaryNoteDTO Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, EuTravelDiaryNoteDTO copy = null) { if (copiedObjects == null) { copiedObjects = new Hashtable(); } if (copy == null && copiedObjects.Contains(this)) { return((EuTravelDiaryNoteDTO)copiedObjects[this]); } copy = copy ?? new EuTravelDiaryNoteDTO(); if (!asNew) { copy.TransientId = this.TransientId; copy.EuTravelDiaryNoteDTOKey = this.EuTravelDiaryNoteDTOKey; } copy.Title = this.Title; copy.Description = this.Description; copy.IsPublic = this.IsPublic; copy.Id = this.Id; if (!copiedObjects.Contains(this)) { copiedObjects.Add(this, copy); } if (deep && this.createdBy != null) { if (!copiedObjects.Contains(this.createdBy)) { if (asNew && reuseNestedObjects) { copy.CreatedBy = this.CreatedBy; } else if (asNew) { copy.CreatedBy = this.CreatedBy.Copy(deep, copiedObjects, true); } else { copy.createdBy = this.createdBy.Copy(deep, copiedObjects, false); } } else { if (asNew) { copy.CreatedBy = (EuTravelDiaryPersonDTO)copiedObjects[this.CreatedBy]; } else { copy.createdBy = (EuTravelDiaryPersonDTO)copiedObjects[this.CreatedBy]; } } } 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); }