Example #1
0
 public Movie Create(Movie entity)
 {
     using (var context = _contextFactory.CreateDbContext())
     {
         var result = context.Set <Movie>().Add(entity);
         context.SaveChanges();
         return(result.Entity);
     }
 }
 public T Create(T entity)
 {
     using (MovieDatabaseDBContext context = _contextFacory.CreateDbContext())
     {
         EntityEntry <T> result = context.Set <T>().Add(entity);
         context.SaveChanges();
         return(result.Entity);
     }
 }