8000 Current culture should not affect the generated cache key · Issue #226 · SharpRepository/SharpRepository · GitHub
[go: up one dir, main page]

Skip to content

Current culture should not affect the generated cache key #226

@Liu79

Description

@Liu79

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.

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

      0