示例#1
0
 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);
     }
 }
示例#2
0
 public long Insert(Film film)
 {
     using (FilmStoreContext context = new FilmStoreContext())
     {
         context.Entry(film).State = EntityState.Added;
         context.SaveChanges();
         return(film.Id);
     }
 }