// // Summary: // /// Method responsible for searching the data. /// // // Parameters: // command: // The command param. // public Task <List <Interview> > FindByFilterAsync(InterviewFilterCommand command) { return(_context.Set <Interview>() .Select(p => p) .Where(p => p.SchedulingDate.Equals(command.SchedulingDate) || p.Squad.Equals(command.Squad) || EF.Functions.ILike(p.Person.Name, @$ "%{command.PersonName}%") || EF.Functions.ILike(p.Person.Email.Value, @$ "%{command.Email}%") || p.Person.Cpf.Value == command.PersonCpf ) .AsNoTracking() .ToListAsync()); }
public async Task <IActionResult> Index([FromQuery] InterviewFilterCommand command) { List <Interview> list = await _interviewRepository.FindByFilterAsync(command); return(Ok(_mapper.Map <List <Interview>, List <InterviewResult> >(list))); }