Dynamically Composing Expression Predicates (only for LINQ to SQL or Entity Framework query)
http://www.albahari.com/nutshell/predicatebuilder.aspx
--use of
https://stackoverflow.com/a/1775057
https://stackoverflow.com/q/877034 (multiple ORs)
https://www.dotnetexample.in/2015/05/dynamic-query-in-linq-using-predicate.html
example - search all columns and rows on datatable
Monty’s Gush revision, Universal PredicateBuilder
https://petemontgomery.wordpress.com/2011/02/10/a-universal-predicatebuilder/
--use of
https://www.c-sharpcorner.com/UploadFile/c42694/dynamic-query-in-linq-using-predicate-builder/
https://www.puresourcecode.com/dotnet/net-core/universal-predicatebuilder-for-expression/
https://damienvdk.com/index.php/2020/11/21/create-c-linq-dynamic-with-predicate-builder/
ZZZ.Dynamic LINQ
https://dynamic-linq.net/
https://www.nuget.org/packages/System.Linq.Dynamic/
reference :
MS.C# Dynamic Query Library (included in the \LinqSamples\DynamicQuery directory) ref
Stackoverflow -Return line and column Index of a value that exists in dataTable
#whereor #multiplelinqors
http://www.albahari.com/nutshell/predicatebuilder.aspx
--use of
https://stackoverflow.com/a/1775057
https://stackoverflow.com/q/877034 (multiple ORs)
https://www.dotnetexample.in/2015/05/dynamic-query-in-linq-using-predicate.html
example - search all columns and rows on datatable
C#:
var predicate = PredicateBuilder.False<DataRow>();
foreach (DataColumn r in _datable.Columns){
predicate = predicate.Or(y => y[r.ColumnName].ToString()!=null && y[r.ColumnName].ToString().Equals(search, StringComparison.OrdinalIgnoreCase));
}
var rows = _datable.AsEnumerable().AsQueryable().Where(predicate).Select(u => new
{
rowIndex = _datable.Rows.IndexOf(u),
cols = u.ItemArray
}).ToList();
Monty’s Gush revision, Universal PredicateBuilder
https://petemontgomery.wordpress.com/2011/02/10/a-universal-predicatebuilder/
--use of
https://www.c-sharpcorner.com/UploadFile/c42694/dynamic-query-in-linq-using-predicate-builder/
https://www.puresourcecode.com/dotnet/net-core/universal-predicatebuilder-for-expression/
https://damienvdk.com/index.php/2020/11/21/create-c-linq-dynamic-with-predicate-builder/
------------- mirror -------------
ZZZ.Dynamic LINQ
https://dynamic-linq.net/
https://www.nuget.org/packages/System.Linq.Dynamic/
reference :
MS.C# Dynamic Query Library (included in the \LinqSamples\DynamicQuery directory) ref
Stackoverflow -Return line and column Index of a value that exists in dataTable
#whereor #multiplelinqors