Esempio n. 1
0
 public void Delete(T entity)
 {
     using (var context = new ProveedoresConnection(_connString))
     {
         context.Set <T>().Remove(entity);
         context.SaveChanges();
     }
 }
Esempio n. 2
0
 public object Create(T entity, string propName)
 {
     using (var context = new ProveedoresConnection(_connString))
     {
         context.Set <T>().Add(entity);
         context.SaveChanges();
         return(entity.GetType().GetProperty(propName).GetValue(entity, null));
     }
 }
Esempio n. 3
0
 public T Get(long Id)
 {
     using (var context = new ProveedoresConnection(_connString))
         return(context.Set <T>().Find((object)Id));
 }