Skip to content

Case sensitive comparison #35851

@rodbeck

Description

@rodbeck

Description

Hi,

By default, the lambda expression m => m.Title!.Contains(TitleFilter ?? string.Empty) is case sensitive, at least, nothing was returned when I searched for "road" or "road warrior" but movies were returned when I searched for "Road" for example.

I had to update the lambda expression to: context.Movie.Where(m => m.Title!.ToLower().Contains((TitleFilter ?? string.Empty).ToLower())); for it to work properly with the lowercase search.

Thanks!

Page URL

https://learn.microsoft.com/en-gb/aspnet/core/blazor/tutorials/movie-database-app/part-6?view=aspnetcore-9.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/tutorials/movie-database-app/part-6.md

Document ID

6d15bd42-ea91-ec59-1ebc-185653dc7ef4

Platform Id

bc8a6fac-a9c8-44e8-4883-26b69c934483

Article author

@guardrex

Metadata

  • ID: 6d15bd42-ea91-ec59-1ebc-185653dc7ef4
  • PlatformId: bc8a6fac-a9c8-44e8-4883-26b69c934483
  • Service: aspnet-core
  • Sub-service: blazor

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions