public void Insert(Film film) { using (FilmStoreContext context = new FilmStoreContext()) { context.Entry(film).State = EntityState.Added; context.SaveChanges(); } }
public bool Delete(Film film) { using (FilmStoreContext context = new FilmStoreContext()) { context.Entry(film).State = EntityState.Deleted; context.SaveChanges(); return(true); } }