public void Update(Comments comment) { using (var context = new ApplicationDbContext()) { context.Entry(comment).State = EntityState.Modified; context.SaveChanges(); } }
public void Add(Comments comment) { using (var context = new ApplicationDbContext()) { context.Comments.Add(comment); context.SaveChanges(); } }