Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8937653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:27:04+00:00 2026-06-15T10:27:04+00:00

I cache a specific list of EF entities in the application start routine of

  • 0

I cache a specific list of EF entities in the application start routine of an asp.net mvc website.

protected void Application_Start()
{
   CountriesDbContext db = new CountriesDbContext();
   HttpRuntime.Cache["Countries"] = db.Countries.ToList();
}

When I request it like below I loose the accent insensitive behaviour

private List<Country> cache = (List<Country>)HttpRuntime.Cache["Countries"];
//Accent insensitive behaviour is lost ! 
results = cache.Where(c => c.FR.ToLower()
               .Contains(search.ToLower())); //for example : e will not match é

If I request it “normally” using dbContext the accent insensitive behaviour is preserved.

private CountriesDbContext db = new CountriesDbContext();
//Accent insensitive behaviour search 
results = db.Countries.Where(c => c.FR.ToLower()
               .Contains(search.ToLower())); //for example : e will match é

Why is that ? and how can I do to preserve accent insensitive behaviour when caching entities ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:27:05+00:00Added an answer on June 15, 2026 at 10:27 am

    Collation is an SQL Server concept, which is why the query works on database data, but not in memory data, where .Net comparison applies.

    So you need to implement an accent-insensitive comparer for your cache in .Net, as sketched in this answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want a ASP.NET cache item to be recycled when a specific file is
I have an ASP.Net MVC web app that includes a set of Forums. In
I'm implementing a content database for a C# Asp.Net MVC3 website in Sql Server.
I am running a background thread in my asp.net web service application. This thread's
Is it possible to query Google's cache with a specific date range. for instance,
I wrote a function for my cache to retrieve a specific object. This way
I'm putting together a REST service using ASP.NET Web API & Ninject, though I
Is it possible to cache only a specific part of a page in PHP,
I'm using JPA to load and persist entities in my Java EE-based web application.
Lets say I have a lists of entities (for example, a list of TODO

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.