public async Task <userToken> getUserByToken(string tokenString) { try { //tokenString = tokenString.Replace("Bearer ", "").Trim(); dbRapChieuPhimContext db = new dbRapChieuPhimContext(); string taiKhoan = parseJWTToEmail(tokenString); userToken nguoiDung = db.NguoiDung.Where(n => n.TaiKhoan == taiKhoan).Select(n => new userToken { taiKhoan = n.TaiKhoan, email = n.Email, maLoaiNguoiDung = n.MaLoaiNguoiDung, maNhom = n.MaNhom }).FirstOrDefault(); if (nguoiDung != null) { return(nguoiDung); } return(null); } catch (Exception ex) { return(null); } }