Пример #1
0
        public UserComment UpdateComment(UserComment commentChanges)
        {
            var comment = context.Comments.Attach(commentChanges);

            comment.State = EntityState.Modified;
            context.SaveChanges();
            return(commentChanges);
        }
Пример #2
0
        public UserComment DeleteUserComment(int id)
        {
            UserComment comment = context.Comments.Find(id);

            if (comment != null)
            {
                context.Comments.Remove(comment);
                context.SaveChanges();
            }
            return(comment);
        }
Пример #3
0
 public UserComment AddUserComment(UserComment comment)
 {
     throw new NotImplementedException();
 }
Пример #4
0
 public UserComment UpdateComment(UserComment commentChanges)
 {
     throw new NotImplementedException();
 }
Пример #5
0
 public UserComment AddUserComment(UserComment comment)
 {
     context.Comments.Add(comment);
     context.SaveChanges();
     return(comment);
 }