Beispiel #1
0
        public void AddComment(ListingComment comment)
        {
            if (Comments == null)
            {
                Comments = new HashSet<ListingComment>();
            }

            Comments.Add(comment);
        }
Beispiel #2
0
        /// <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);
        }
Beispiel #3
0
        /// <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);
 }
Beispiel #6
0
        public ListingComment RemoveListingComment(ListingComment comment)
        {
            if (ListingComments.Contains(comment))
            {
                ListingComments.Remove(comment);
                return comment;
            }

            return null;
        }
Beispiel #7
0
 public void AddListingComment(ListingComment comment)
 {
     comment.Listing = this;
     ListingComments.Add(comment);
 }