public bool Update(Film film) { using (FilmStoreContext context = new FilmStoreContext()) { context.Entry(film).State = EntityState.Modified; int i = context.SaveChanges(); return(i == 1 ? true : false); } }
public long Insert(Film film) { using (FilmStoreContext context = new FilmStoreContext()) { context.Entry(film).State = EntityState.Added; context.SaveChanges(); return(film.Id); } }