diff --git a/aspnetcore/blazor/tutorials/movie-database-app/part-6.md b/aspnetcore/blazor/tutorials/movie-database-app/part-6.md index e4ea174683b6..4cb4a014bf28 100644 --- a/aspnetcore/blazor/tutorials/movie-database-app/part-6.md +++ b/aspnetcore/blazor/tutorials/movie-database-app/part-6.md @@ -58,7 +58,16 @@ Change the `QuickGrid` component's movie.Title!.Contains(...)` code is a *lambda expression*. Lambdas are used in method-based LINQ queries as arguments to standard query operator methods such as the or methods. LINQ queries aren't executed when they're defined or when they're modified by calling a method, such as , , or . Rather, query execution is deferred. The evaluation of an expression is delayed until its realized value is iterated. -The method is run on the database, not in the C# code. The case sensitivity of the query depends on the database and the collation. For SQL Server, maps to [SQL `LIKE`](/sql/t-sql/language-elements/like-transact-sql), which is case insensitive. SQLite with default collation provides a mixture of case sensitive and case insensitive filtering, depending on the query. For information on making case insensitive SQLite queries, see the [Additional resources](#additional-resources) section of this article. +The method is run on the database, not in the C# code. The case sensitivity of the query depends on the database and the collation. For SQL Server, maps to [SQL `LIKE`](/sql/t-sql/language-elements/like-transact-sql), which is case insensitive. SQLite with default collation provides a mixture of case-sensitive and case-insensitive filtering, depending on the query. The remainder of this tutorial assumes case-insensitive database collation. + +To adopt case-insensitive collation when using SQLite ( is called in `Program.cs`), open the `Data/BlazorWebAppMoviesContext.cs` file. Inside the `BlazorWebAppMoviesContext` class, add the following code: + +```csharp +protected override void OnModelCreating(ModelBuilder modelBuilder) +{ + modelBuilder.UseCollation("SQL_Latin1_General_CP1_CS_AS"); +} +``` Run the app and navigate to the movies `Index` page at `/movies`. The movies in the database load: @@ -143,10 +152,7 @@ Stop the app by closing the browser's window and pressing Ctrl+C * [LINQ documentation](/dotnet/csharp/programming-guide/concepts/linq/) * [Write C# LINQ queries to query data (C# documentation)](/dotnet/csharp/programming-guide/concepts/linq/query-syntax-and-method-syntax-in-linq) * [Lambda Expression (C# documentation](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions) -* Case insensitive SQLite queries - * [How to use case-insensitive query with Sqlite provider? (`dotnet/efcore` #11414)](https://github.com/dotnet/efcore/issues/11414) - * [How to make a SQLite column case insensitive (`dotnet/AspNetCore.Docs` #22314)](https://github.com/dotnet/AspNetCore.Docs/issues/22314) - * [Collations and Case Sensitivity](/ef/core/miscellaneous/collations-and-case-sensitivity) +* [Collations and Case Sensitivity](/ef/core/miscellaneous/collations-and-case-sensitivity) ## Legal