//DELETE ------------------------
        public async Task Delete(Student student)
        {
            await Task.Factory.StartNew(() =>
            {
                context.Set <Student>().Remove(student);
            });

            await context.SaveChangesAsync();
        }
Esempio n. 2
0
        //DELETE ------------------------
        public async Task Delete(Education education)
        {
            await Task.Factory.StartNew(() =>
            {
                context.Set <Education>().Remove(education);
            });

            //doe hier een archivering van education ipv delete -> veiliger
            await context.SaveChangesAsync();
        }
 public GenericRepository(SchoolDBContext _context)
 {
     this._context = _context;
     table         = _context.Set <T>();
 }
 public GenericRepository(SchoolDBContext schoolDBContext)
 {
     _schoolDBContext = schoolDBContext;
     _DbSet           = _schoolDBContext.Set <T>();
 }
Esempio n. 5
0
 public StudentService(SchoolDBContext context)
 {
     _context   = context;
     _studDbSet = _context.Set <Student>();
 }
Esempio n. 6
0
 public GenericRepository(SchoolDBContext context)
 {
     this.context = context;
     this.dbSet   = context.Set <TEntity>();
 }
Esempio n. 7
0
 public TeacherService(SchoolDBContext context)
 {
     _context      = context;
     _teacherDbSet = _context.Set <Teacher>();
 }
 public StudentRepository(SchoolDBContext _context)
 {
     this._context = _context;
     _students     = _context.Set <Student>();
 }
Esempio n. 9
0
 public UserService(SchoolDBContext context)
 {
     _context   = context;
     _userDbSet = _context.Set <User>();
 }