Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Current culture should not affect the generated cache key #226

Copy link
Copy link
@Liu79

Description

@Liu79
Issue body actions

When using a specification containing a language dependent condition, my expected behavior is that the generated hash for the cache key should be the same in every culture.

var date = DateTime.Now;
var culture = new System.Globalization.CultureInfo("en");

System.Threading.Thread.CurrentThread.CurrentCulture = culture;
System.Threading.Thread.CurrentThread.CurrentUICulture = culture;

var spec1 = new Specification<Contact>(p => p.Date >= date);
var hash1 = HashGenerator.FromSpecification(spec1);

culture = new System.Globalization.CultureInfo("it");
System.Threading.Thread.CurrentThread.CurrentCulture = culture;
System.Threading.Thread.CurrentThread.CurrentUICulture = culture;

var spec2 = new Specification<Contact>(p => p.Date >= date);
var hash2 = HashGenerator.FromSpecification(spec2);

hash1.ShouldBe(hash2);

I think that the current language should not affect the generated key.

giocaputo and wufe

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.