public T Update <T>(T model) where T : class { using (AdapterDesingPatternContext adapterDesingPatternContext = new AdapterDesingPatternContext()) { adapterDesingPatternContext.Set <T>().Update(model); adapterDesingPatternContext.SaveChanges(); } return(model); }
public void Delete <T>(int id) where T : class { T model = Find <T>(id); using (AdapterDesingPatternContext adapterDesingPatternContext = new AdapterDesingPatternContext()) { adapterDesingPatternContext.Set <T>().Remove(model); adapterDesingPatternContext.SaveChanges(); } }