public void Delete(T pObject) { using (JobFinderDbContext context = new JobFinderDbContext()) { context.Set <T>().Remove(pObject); context.SaveChanges(); } }
public void Add(T pObject) { using (JobFinderDbContext context = new JobFinderDbContext()) { context.Set <T>().Add(pObject); context.SaveChanges(); } }
public async Task <IEnumerable <T> > GetAllAsync() { using (JobFinderDbContext context = new JobFinderDbContext()) return(await context.Set <T>().ToListAsync <T>()); }
public IEnumerable <T> GetAll() { using (JobFinderDbContext context = new JobFinderDbContext()) return(context.Set <T>()); }
public T Get(int pId) { using (JobFinderDbContext context = new JobFinderDbContext()) return(context.Set <T>().Find(pId)); }