/// <summary> /// Makes a clone (deep copy) of this object /// </summary> /// <returns>TravelPost Object</returns> public TravelPost Clone() { TravelPost post = new TravelPost(); post.Id = Id; post.Title = Title; post.Message = Message; post.PostTime = PostTime; post.IsNew = IsNew; post.IsModified = IsModified; if (_user != null) { post._user = _user.Clone(); } if (_imageCollection != null) { foreach (TravelImage image in _imageCollection) { post.AddImage(image.Clone()); } } return(post); }
/// <summary> /// Makes a clone (deep copy) of this object /// </summary> public TravelImage Clone() { TravelImage image = new TravelImage(); image.Id = Id; image.Path = Path; image.Title = Title; image.Description = Description; image.Latitude = Latitude; image.Longitude = Longitude; image.RatingCount = RatingCount; image.RatingAverage = RatingAverage; image.IsNew = IsNew; image.IsModified = IsModified; if (_user != null) { image._user = _user.Clone(); } if (_city != null) { image._city = _city.Clone(); } if (_country != null) { image._country = _country.Clone(); } if (_post != null) { image._post = _post.Clone(); } return(image); }