public static RoleDto ToDto(this Role entity, Guid userId) { RoleDto dto = entity.MapTo<RoleDto>(); dto.Checked = entity.Users.Select(u => u.Id).Contains(userId); return dto; }