public IEnumerable <GetResidentQueryResult> GetAllByApartment( Guid id, [FromServices] IResidentRepository repository, [FromServices] IMapper mapper ) { var user = User.Claims.FirstOrDefault(x => x.Type == "user_id")?.Value; var result = repository.GetAllByApartment(user, id); return(mapper.Map <List <GetResidentQueryResult> >(result)); }