public PaginationResult <Equipment> Search(SearchEquipmentRequest request) { return(_repoService.Search <Equipment>(request, "Equipment", "Title", (sb, parameters) => { sb.AppendNotNull(request.Title, " Title LIKE CONCAT('%',@Title,'%') OR OtherTitle LIKE CONCAT('%',@Title,'%') ", parameters, nameof(request.Title), request.Title) .AppendNotNull(request.ExerciseId, " EXISTS(select * from [ExerciseEquipment] em where em.EquipmentId = e.Id AND em.ExerciseId = @ExerciseId)", parameters, nameof(request.ExerciseId), request.ExerciseId); })); }
public PaginationResult <Equipment> Post([FromBody] SearchEquipmentRequest request) { return(_equipmentService.Search(request)); }