public bool Update(T obj) { using (var d = new PlasticFactoryEntities()) try { DbSet dSet = d.Set <T>(); dSet.Attach(obj); d.Entry(obj).State = EntityState.Modified; d.SaveChanges(); return(true); } catch { throw; } }
public Responsity() { this.db = new PlasticFactoryEntities(); this.dbSet = db.Set <T>(); }