Skip to content

Current culture should not affect the generated cache key #226

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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