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

Specification hash breaking change for sql IN operator #223

Copy link
Copy link
@Liu79

Description

@Liu79
Issue body actions

I upgraded the SharpRepository packages of a solution from version 1.5.0.2 to version 2.0.4.3, and I noticed that the generated cache key is different between the two releases when the sql "IN" operator is used.
For example, a typical query like the following:

var collection1 = new List<int>() { 1, 2, 3 };
var collection2 = new List<int>() { 4, 5, 6 };

var results1 = repo.FindAll(x => collection1.Contains(x.Id));
var results2 = repo.FindAll(x => collection2.Contains(x.Id));

should produce two different cache keys because the collection values are different, instead version 2.0.4.3 produces the same value.

So I checked the unit test code and found that a "Different_Predicate_With_Variable_Array_Will_Give_Different_Hash" unit test exists, but in the v1.5.0.2 it correctly checks that

hash1.ShouldNotEqual(hash2).

Instead the newer 2.0.2 version checks

hash1.ShouldBe(hash2) 

that is obviously wrong.

Is this an intentional breaking change or just a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    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.