public UserComment UpdateComment(UserComment commentChanges) { var comment = context.Comments.Attach(commentChanges); comment.State = EntityState.Modified; context.SaveChanges(); return(commentChanges); }
public UserComment DeleteUserComment(int id) { UserComment comment = context.Comments.Find(id); if (comment != null) { context.Comments.Remove(comment); context.SaveChanges(); } return(comment); }
public UserComment AddUserComment(UserComment comment) { throw new NotImplementedException(); }
public UserComment UpdateComment(UserComment commentChanges) { throw new NotImplementedException(); }
public UserComment AddUserComment(UserComment comment) { context.Comments.Add(comment); context.SaveChanges(); return(comment); }