using LMS.Repository.Models.DB; using Microsoft.AspNetCore.Identity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LMS.DAO.RoleDAO { public class RoleBasicDao(ApplicationDbContext context, RoleManager roleManager) { private readonly ApplicationDbContext _context = context; private readonly RoleManager _roleManager = roleManager; /// /// 检查角色是不是存在 /// /// /// public async Task CheckRoleExistById(long? roleId) { if (roleId == null) return false; return await _roleManager.FindByIdAsync(roleId.ToString()) != null; } } }