Base solution for your next web application

Activities of "ricardo"

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

Showing 21 to 21 of 21 entries