Skip to content

Commit e8ce06d

Browse files
authored
Merge pull request #106 from tghamm/feature/1.3.0
Feature/1.3.0
2 parents ec56101 + fb2283d commit e8ce06d

File tree

4 files changed

+48
-5
lines changed

4 files changed

+48
-5
lines changed

Castle.DynamicLinqQueryBuilder.SystemTextJson/Castle.DynamicLinqQueryBuilder.SystemTextJson.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<FileAlignment>512</FileAlignment>
1313
<TargetFrameworkProfile />
1414
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
15-
<Version>1.2.9</Version>
15+
<Version>1.3.0</Version>
1616
<Authors>Grant Hamm</Authors>
1717
<Company>N/A</Company>
1818
<Product>Dynamic Linq Query Builder - System.Text.Json Extension</Product>
1919
<Description>A companion package for those using System.Text.Json</Description>
20-
<Copyright>Copyright Grant Hamm 2022</Copyright>
20+
<Copyright>Copyright Grant Hamm 2023</Copyright>
2121
<PackageLicenseUrl>https://github.com/tghamm/dynamic-linq-query-builder/blob/master/LICENSE.md</PackageLicenseUrl>
2222
<PackageProjectUrl>https://github.com/tghamm/dynamic-linq-query-builder/</PackageProjectUrl>
2323
<RepositoryUrl>https://github.com/tghamm/dynamic-linq-query-builder/</RepositoryUrl>

Castle.DynamicLinqQueryBuilder.Tests/Rules/JsonNetFilterRuleTests.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3350,6 +3350,14 @@ private class DictionaryClass
33503350

33513351
}
33523352

3353+
private class DictionaryClassFail
3354+
{
3355+
public DictionaryClassFail() { DynamicData = new Dictionary<int, object>(); }
3356+
3357+
public Dictionary<int, object> DynamicData { get; set; }
3358+
3359+
}
3360+
33533361
private class DictionaryClassConcrete
33543362
{
33553363
public DictionaryClassConcrete() { DynamicData = new Dictionary<string, DataValue>(); }
@@ -3431,6 +3439,40 @@ public void DictionaryExpression_Test()
34313439
var resultList = result.ToList();
34323440
Assert.AreEqual(resultList[0].DynamicData["test"], "test");
34333441
}
3442+
3443+
[Test]
3444+
public void DictionaryExpression_Test_Fail()
3445+
{
3446+
var rule = new JsonNetFilterRule
3447+
{
3448+
Condition = "and",
3449+
Rules = new List<JsonNetFilterRule>
3450+
{
3451+
new JsonNetFilterRule
3452+
{
3453+
Condition = "and",
3454+
Field = "DynamicData.test",
3455+
Id = "Id",
3456+
Operator = "equal",
3457+
Type = "string",
3458+
Value = "test"
3459+
}
3460+
}
3461+
};
3462+
var d1 = new DictionaryClassFail();
3463+
d1.DynamicData.Add(1, "test");
3464+
var d2 = new DictionaryClassFail();
3465+
d2.DynamicData.Add(1, "NotTest");
3466+
3467+
3468+
3469+
ExceptionAssert.Throws<NotSupportedException>(() =>
3470+
{
3471+
var result = new List<DictionaryClassFail> { d1, d2 }.AsQueryable().BuildQuery(rule,
3472+
new BuildExpressionOptions());
3473+
});
3474+
3475+
}
34343476
#endregion
34353477
}
34363478
}

Castle.DynamicLinqQueryBuilder/Castle.DynamicLinqQueryBuilder.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<FileAlignment>512</FileAlignment>
1313
<TargetFrameworkProfile />
1414
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
15-
<Version>1.2.9</Version>
15+
<Version>1.3.0</Version>
1616
<Authors>Grant Hamm</Authors>
1717
<Company>N/A</Company>
1818
<Product>Dynamic Linq Query Builder</Product>
1919
<Description>A simple dynamic expression-tree query builder. You pass it a nested collection of filters for an object, and it materializes a query capable of acting as the filter to an arbitrary collection.</Description>
20-
<Copyright>Copyright Grant Hamm 2022</Copyright>
20+
<Copyright>Copyright Grant Hamm 2023</Copyright>
2121
<PackageLicenseUrl>https://github.com/tghamm/dynamic-linq-query-builder/blob/master/LICENSE.md</PackageLicenseUrl>
2222
<PackageProjectUrl>https://github.com/tghamm/dynamic-linq-query-builder/</PackageProjectUrl>
2323
<RepositoryUrl>https://github.com/tghamm/dynamic-linq-query-builder/</RepositoryUrl>

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
`dynamic-linq-query-builder` is a small library that allows any `.Net` framework class collection to be filtered dynamically at runtime.
55

6-
Features (v1.2.9)
6+
Features (v1.3.0)
77
--
88
* Generates an `IQueryable` from any collection and filter combination
99
* Capable of complex, grouped queries against as many fields as you want
1010
* Supports nested objects and collections via dot notation
11+
* Supports `Dictionary<string, object>` collections
1112
* Supports a number of operators for each type
1213
* in
1314
* not in

0 commit comments

Comments
 (0)