Esempio n. 1
0
 public TaiKhoan DangNhap(TaiKhoan taiKhoan)
 {
     try
     {
         var taiKhoanDangNhap =
             _context.Set <TaiKhoan>()
             .FirstOrDefault(x => x.TenDangNhap == taiKhoan.TenDangNhap && x.MatKhau == taiKhoan.MatKhau);
         if (taiKhoanDangNhap != null)
         {
             return(taiKhoanDangNhap);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     return(null);
 }
Esempio n. 2
0
 public List <Khoa> GetKhoas()
 {
     return(_context.Set <Khoa>().ToList());
 }
Esempio n. 3
0
 public IList <MonHoc> GetMonHocs()
 {
     return(_context.Set <MonHoc>().Where(x => x.Deleted == false).ToList());
 }
Esempio n. 4
0
 public IEnumerable <TEntity> Where(Expression <Func <TEntity, bool> > predicate)
 {
     return(_context.Set <TEntity>().AsNoTracking().Where(predicate));
 }
Esempio n. 5
0
 public BaseRepository(QLSVDbContext context)
 {
     _context = context;
     _dbSet   = context.Set <TEntity>();
 }
Esempio n. 6
0
 public IList <Lop> GetByKhoaId(int id)
 {
     return(_context.Set <Lop>().Where(x => x.KhoaId == id).ToList());
 }