dynamic-linq-query-builder
LINQKit
Our great sponsors
dynamic-linq-query-builder | LINQKit | |
---|---|---|
2 | 6 | |
247 | 1,565 | |
1.6% | - | |
6.7 | 3.5 | |
8 months ago | 3 months ago | |
C# | C# | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
dynamic-linq-query-builder
- Dynamically building Linq queries
-
Build dynamic Linq filters (aka. where() predicates)
I ran into this use case a while ago, and I saw a similar inplementation under the jquery UI query builder plugin. https://querybuilder.js.org/. There's an inplementation for .net on the site. https://github.com/castle-it/dynamic-linq-query-builder. Fast foward to today, I no longer use this approach and switched to OData. The backend expose a queryable dataset. Frontend just need to build the querystring to hit the backend Odata api endpoint. I think this approach is much cleaner.
LINQKit
-
What your hidden nuget gems ?
I also enjoy LinqKit (mentioned here). Really cool way to build a LINQ predicate.
-
EF Core Include where
I would suggest to install LINQKit Configure DbContextOptions: cs builder .UseSqlServer(connectionString) .WithExpressionExpanding(); // enabling LINQKit extension
- Як я мігрував з EF 6 до EF Core 5
-
Build dynamic Linq filters (aka. where() predicates)
Nice! At work we do something similar, but we use the predicate builder of linqkit: https://github.com/scottksmith95/LINQKit
-
Expression<Func<T>> usage in filters and sorting
To answer your other question, you can use something like PredicateBuilder to compose predicates for use in Where and OrderBy methods. To define your OrderBy with a boolean (or string or enum) to denote the ordering, you would have to make an extension method like so:
What are some alternatives?
Sieve - ⚗️ Clean & extensible Sorting, Filtering, and Pagination for ASP.NET Core
Linq.Expression.Optimizer - System.Linq.Expression expressions optimizer. http://thorium.github.io/Linq.Expression.Optimizer
System.Linq.Dynamic.Core - The .NET Standard / .NET Core version from the System Linq Dynamic functionality.
DynamicExpresso - C# expressions interpreter
Dapper Extensions - Dapper Extensions is a small library that complements Dapper by adding basic CRUD operations (Get, Insert, Update, Delete) for your POCOs. For more advanced querying scenarios, Dapper Extensions provides a predicate system. The goal of this library is to keep your POCOs pure by not requiring any attributes or base class inheritance.
Remote.Linq - Simply LINQ your remote resources...
MongoDB Repository pattern implementation
NSpecifications - Specification Pattern for .Net
LINQ to DB - Linq to database provider.
Fluent NHibernate - Fluent NHibernate!
Entity Framework - EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.