コード例 #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();
        }
コード例 #3
0
 public GenericRepository(SchoolDBContext _context)
 {
     this._context = _context;
     table         = _context.Set <T>();
 }
コード例 #4
0
 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>();
 }
コード例 #8
0
 public StudentRepository(SchoolDBContext _context)
 {
     this._context = _context;
     _students     = _context.Set <Student>();
 }
コード例 #9
0
 public UserService(SchoolDBContext context)
 {
     _context   = context;
     _userDbSet = _context.Set <User>();
 }