Comments (5)
It should be fixed in v2.3.3
.
thank you
from gridify.
Thank you, it's working well now.
from gridify.
Hi, thank you for the feedback.
Testing these edge cases is too complicated, also I'm not sure yet whether I fixed this issue or not yet.
can you please confirm that you expected this query to be generated or not?
l1 => l1.Level2List.Any(x => (x.Level3.Level4List[0].Property1 > 5))
from gridify.
This bug seems to fixed for List but I get errors with arrays, System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'
on line var expression = gridifyQuery.GetFilteringExpression(gridifyMapper).Compile();
This isn't just with index or nested parameters.
Example:
using Gridify;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApp1
{
public static class Program
{
public static void Main(string[] args)
{
var test = new Test();
test.Run();
}
}
public class Test
{
public void Run()
{
List<Level1> level1List = new List<Level1>();
level1List.Add(new Level1());
var gridifyMapper = new GridifyMapper<Level1>().GenerateMappings()
.AddMap("level4_property1", (q, index) => q.Level2List.Select(x => x.Level3.Level4List[index].Property1));
var gridifyQuery = new GridifyQuery() { Filter = "level4_property1[0] > 5" };
var expression = gridifyQuery.GetFilteringExpression(gridifyMapper).Compile();
var query = level1List.Where(expression);
}
}
public class Level1
{
public string Name { get; set; }
public Level2[] Level2List = new Level2[]
{
new Level2()
{
Name = "1",
Level3 = new Level3()
{
Name = "2",
Level4List = new List<Level4>()
{
new Level4() {Name = "3", Property1 = 3, Property2 = 4},
new Level4() {Name = "4", Property1 = 4, Property2 = 5},
new Level4() {Name = "5", Property1 = 5, Property2 = 6}
}
}
},
new Level2()
{
Name = "6",
Level3 = new Level3()
{
Name = "7",
Level4List = new List<Level4>()
{
new Level4() {Name = "8", Property1 = 8, Property2 = 9},
new Level4() {Name = "9", Property1 = 9, Property2 = 10},
new Level4() {Name = "10", Property1 = 10, Property2 = 11}
}
}
},
};
}
public class Level2
{
public string Name { get; set; }
public Level3 Level3 = new Level3();
}
public class Level3
{
public string Name { get; set; }
public List<Level4> Level4List = new List<Level4>();
}
public class Level4
{
public string Name { get; set; }
public double Property1 { get; set; }
public double Property2 { get; set; }
}
}
from gridify.
This is a different problem that was fixed in v2.4.4
.
from gridify.
Related Issues (20)
- Possibility to use Gridify (as parser) to create your own non-LINQ query builder HOT 2
- add support automatic mapping generation for child classes HOT 1
- Update documentation site dependencies (Vuepress2)
- Gridify.Elasticsearch generate DSL query (non-generic) HOT 3
- JavaScript client library HOT 3
- Creating an Abstractions Layer for Gridify
- Error "Specified method is not supported" when querying the Nested List field in Elasticsearch HOT 2
- DateTime Kind and PostgreSQL HOT 13
- IN style operator HOT 5
- Support for. NET8 HOT 4
- NativeAOT support
- Why library can not resolve IGridifyMapper<T> default in DbContext.ServiceProvider if exists HOT 1
- GRPC Support HOT 2
- Comparing data between two fields rather than using hardcoded values
- Cleanup dependencies HOT 2
- Filtering based on IDictionary values
- Passing filter value on CustomOperator Expression creation - for ContainsAny operator HOT 10
- Support automatic mapping generation for list of primitives
- Filtering for null/empty case insensitive HOT 1
- EntityFramework filtering with Many to Many case
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gridify.