From f9e47194a8a0eb5b677ab131efbf7ad0c9aa5389 Mon Sep 17 00:00:00 2001 From: MaxchilKH Date: Thu, 16 Jul 2020 16:34:30 +0200 Subject: [PATCH] Commit message lol --- .../Controllers/CompaniesController.cs | 10 +++++----- src/InternshipSystem.Api/InternshipSystem.Api.csproj | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/InternshipSystem.Api/Controllers/CompaniesController.cs b/src/InternshipSystem.Api/Controllers/CompaniesController.cs index d11c540..f08aae1 100644 --- a/src/InternshipSystem.Api/Controllers/CompaniesController.cs +++ b/src/InternshipSystem.Api/Controllers/CompaniesController.cs @@ -24,16 +24,16 @@ namespace InternshipSystem.Api.Controllers /// /// Get companies matching provided paginated query /// - /// Paginated query description + /// Paginated query description /// Part of companies collection [HttpGet] [ProducesResponseType(StatusCodes.Status200OK)] - public async Task> SearchByNameAsync([FromQuery]SearchQuery query, CancellationToken cancellationToken) => + public async Task> SearchByNameAsync([FromQuery] SearchQuery searchQuery, CancellationToken cancellationToken) => await Context.Companies - .Where(c => c.Name.Contains(query.Query)) + .Where(c => c.Name.ToLower().Contains(searchQuery.Query.ToLower())) .OrderBy(o => o.Name) - .Skip(query.Page * query.PerPage) - .Take(query.PerPage) + .Skip(searchQuery.Page * searchQuery.PerPage) + .Take(searchQuery.PerPage) .ToListAsync(cancellationToken); } diff --git a/src/InternshipSystem.Api/InternshipSystem.Api.csproj b/src/InternshipSystem.Api/InternshipSystem.Api.csproj index a5a067d..e084254 100644 --- a/src/InternshipSystem.Api/InternshipSystem.Api.csproj +++ b/src/InternshipSystem.Api/InternshipSystem.Api.csproj @@ -7,11 +7,13 @@ + + -- 2.45.2