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