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 @@ + +