Exemplo n.º 1
0
 public void AddMovie(Movy movie)
 {
     try
     {
         using (var context = new MediaEntities())
         {
             context.Movies.Add(movie);
             context.SaveChanges();
         }
     }
     catch (Exception e)
     {
         throw new Exception("Couldnt add to db", e);
     }
 }
Exemplo n.º 2
0
 public static void Edit(this Movy movie, string name)
 {
     try
     {
         using (var context = new MediaEntities())
         {
             movie.Name = name;
             context.SaveChanges();
         }
     }
     catch (Exception e)
     {
         throw new Exception("Could not save media", e);
     }
 }