Beispiel #1
0
 public void AddPunct4(Punct4 punct)
 {
     using (var context = new MasterContext())
     {
         context.Set <Punct4>().Add(punct);
         context.SaveChanges();
     }
 }
Beispiel #2
0
 public void AddProduct(Product product)
 {
     using (var context = new MasterContext())
     {
         context.Set <Product>().Add(product);
         context.SaveChanges();
     }
 }
Beispiel #3
0
 public void AddClient(Client client)
 {
     using (var context = new MasterContext())
     {
         context.Set <Client>().Add(client);
         context.SaveChanges();
     }
 }
Beispiel #4
0
 public Repository(MasterContext context)
 {
     if (context != null)
     {
         masterContext = context;
         dbSet         = masterContext.Set <T>();
     }
 }
 public void Add(T entity)
 {
     context.Set <T>().Add(entity);
 }
Beispiel #6
0
 public T Get(int entityID)
 {
     return(_context.Set <T>().Find(entityID));
 }
 public IEnumerable <TEntity> GetAll()
 {
     return(_context.Set <TEntity>().ToList());//lista nula
 }
 public BaseRepository(MasterContext context)
 {
     _context = context;
     dbSet    = context.Set <TEntity>();
 }