Hi @musa.demir
thanks for the return.
did as follows:
[UnitOfWork]
public virtual async Task<List<Colaborador>> GetColaboradoresForUserIncludingChildOusAsync()
{
var user = await _userManager.GetUserByIdAsync((long)AbpSession.UserId);
var organizationUnits = await _userManager.GetOrganizationUnitsAsync(user);
var organizationUnitCodes = organizationUnits.Select(ou => ou.Code).ToList();
var filter = PredicateBuilder.New<Colaborador>();
foreach (var code in organizationUnitCodes)
{
filter = filter.Or(ou => ou.OrganizationUnitFk.Code.StartsWith(code));
}
var filteredColaboradores = _colaboradorRepository.GetAll().Where(filter);
return await filteredColaboradores.ToListAsync();
}
thanks for the help