Ejemplo n.º 1
0
 /// <summary>
 /// 判断登录组名是否存在
 /// </summary>
 /// <param name="roleId">组id</param>
 /// <param name="roleName">组名</param>
 /// <returns></returns>
 public Task <bool> CheckRoleNameExists(int roleId, string roleName)
 {
     if (roleId > 0)
     {
         if (_sysRoleRepository.Exists(p => p.RoleId != roleId && p.RoleName == roleName))
         {
             return(Task.FromResult(true));
         }
     }
     else
     {
         if (_sysRoleRepository.Exists(p => p.RoleName == roleName))
         {
             return(Task.FromResult(true));
         }
     }
     return(Task.FromResult(false));
 }