title: DDD pass filters through multiple layers
body: <p>In my onion architecture I've my PresentationLayer who contains a class named LogRabbitMQFilters with differents properties to filter search.</p>
  <p><a href="https://i.stack.imgur.com/IDOVX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IDOVX.png" alt="LogRabbitMQFilters " /></a></p>
  <p>I pass LogRabbitMQFilters in ApplicationLayer by mapper :</p>
  <pre><code>    public RabbitMQController(IELKService iELKService, IMapper mapper)
      {
          _iELKService = iELKService;
          _mapper = mapper;
      }
  
      public async Task&lt;IActionResult&gt; Index(int? id, LogRabbitMQFilters filters)
      {
          var filtersMapped = _mapper.Map&lt;LogRabbitMQFilters&gt;(filters);
  
          var response = await _iELKService.GetLog(filtersMapped);
  
          /*some code.....*/
      }
  </code></pre>
  <p>In ApplicationLayer I map my logRabbitMQFilters to RabbitMQFilters which is declare in Persistance layer and I call  my repository like this :</p>
  <pre><code>    public ELKService(IELKRepository iELKRepository, IMapper mapper)
      {
          _iELKRepository = iELKRepository;
          _mapper = mapper;
      }
  
      public async Task&lt;LogResult&gt; GetLog(LogRabbitMQFilters  logRabbitMQFilters)
      {
          var filterMapped = _mapper.Map&lt;RabbitMQFilters&gt;(logRabbitMQFilters);
  
          return await _iELKRepository.GetLogs(filterMapped); 
      }
  </code></pre>
  <p>It's best approch to do this ?  Is there another way to pass my filters class to the repository ? I thought of specification pattern but I don't now if it's a good solution.</p>