Ejemplo n.º 1
0
 public int Update(T entity)
 {
     using (var dbContext = new BuildingContext())
     {
         dbContext.Entry(entity).State = EntityState.Modified;
         return(dbContext.SaveChanges());
     }
 }
Ejemplo n.º 2
0
 public int Insert(T entity)
 {
     using (var dbContext = new BuildingContext())
     {
         dbContext.Entry(entity).State = EntityState.Added;
         return(dbContext.SaveChanges());
     }
 }