public void AddComment(ListingComment comment) { if (Comments == null) { Comments = new HashSet<ListingComment>(); } Comments.Add(comment); }
/// <summary> Adds an associated listing comment to this listing. </summary> /// <param name="comment"> The listing comment entity to add to this listing. </param> public void AddListingComment(ListingComment comment) { if (ListingComments == null) { ListingComments = new HashSet <ListingComment>(); } comment.Listing = this; ListingComments.Add(comment); }
/// <summary> Removes the specified listing comment entity from this listing. </summary> /// <param name="comment"> The listing comment entity to remove from this listing </param> /// <returns> Returns the removed listing comment entity, if it existed, returns null otherwise. </returns> public ListingComment RemoveListingComment(ListingComment comment) { if (this?.ListingComments?.Count == 0) { return(null); } if (ListingComments.Contains(comment)) { ListingComments.Remove(comment); return(comment); } return(null); }
public void UpdateListingComment(ListingComment listingComment) { ListingComment targetListingComment = context.ListingComments.Find(listingComment.ListingCommentID); if (targetListingComment != null) { targetListingComment.Comment = listingComment.Comment; targetListingComment.IsEdited = listingComment.IsEdited; targetListingComment.LastEdited = listingComment.LastEdited; targetListingComment.ListingID = listingComment.ListingID; targetListingComment.PostDate = listingComment.PostDate; targetListingComment.UserID = listingComment.UserID; } }
public void InsertListingComment(ListingComment listingComment) { context.ListingComments.Add(listingComment); }
public ListingComment RemoveListingComment(ListingComment comment) { if (ListingComments.Contains(comment)) { ListingComments.Remove(comment); return comment; } return null; }
public void AddListingComment(ListingComment comment) { comment.Listing = this; ListingComments.Add(comment); }