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

            await context.SaveChangesAsync();
        }
예제 #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>();
 }
예제 #5
0
 public StudentService(SchoolDBContext context)
 {
     _context   = context;
     _studDbSet = _context.Set <Student>();
 }
예제 #6
0
 public GenericRepository(SchoolDBContext context)
 {
     this.context = context;
     this.dbSet   = context.Set <TEntity>();
 }
예제 #7
0
 public TeacherService(SchoolDBContext context)
 {
     _context      = context;
     _teacherDbSet = _context.Set <Teacher>();
 }
 public StudentRepository(SchoolDBContext _context)
 {
     this._context = _context;
     _students     = _context.Set <Student>();
 }
예제 #9
0
 public UserService(SchoolDBContext context)
 {
     _context   = context;
     _userDbSet = _context.Set <User>();
 }