public IEnumerable <T> GetAll() { using (ToTheListContext db = new ToTheListContext()) { return(db.Set <T>().ToList()); } }
public T GetById(int id) { using (ToTheListContext db = new ToTheListContext()) { return(db.Set <T>().Find(id)); } }
public void Create(T entity) { using (ToTheListContext db = new ToTheListContext()) { db.Set <T>().Add(entity); db.SaveChanges(); } }