public void Add(Konu konu) { using (ClassProjectDBContext context = new ClassProjectDBContext()) { context.KonuTbl.Add(konu); context.SaveChanges(); } }
public void Update(Konu konu) { using (ClassProjectDBContext context = new ClassProjectDBContext()) { var entity = context.Entry(konu); entity.State = EntityState.Modified; context.SaveChanges(); } }