How to create dynamic-linq where for a List of Dictionary?


0 votes
asked Mar 16, 2016 by shumski_2528 (500 points)
I've been using dynamic-linq to filter list of object using simple Where clause:public class Employee{ public int Age = 0; public string FirstName = "";}var list1 = new.

5 Answers

–1 vote
answered Mar 23, 2016 by Jbe7793 (330 points)

Let's say a admin user want to filter the product list. And even linq itself can be used to 'dynamicly' construct a query.
The great benefit of the 'old' linq is the fact that's it's strong typed.
commented Mar 23, 2016 by Garate (160 points)
How to handel it with LinqDatasource Insert/Update, etc
commented Mar 24, 2016 by Zwack_So (1,410 points)
I encountered this same problem in an app that had very minimal use of sessions. There is a glitch that means you might need to tweak your connection string
commented Mar 25, 2016 by todenapoli (650 points)
I think another aspect of this is that the code is what is important. For an overview look at this picture
0 votes
answered May 31, 2016 by gur7911 (140 points)

Just wondering if your example is fit for object which are dynamic.
0 votes
answered Jun 2, 2016 by Wittenburg (150 points)

The list itself is initialized with a collection initializer. Each student in the list is initialized with an object initializer.
Create a C# Project To create a project Start Visual Studio.
0 votes
answered Jun 2, 2016 by Unmappedbr (150 points)
Have a look at my website, http://weblogs.asp.net/scottgu/dynamic-linq-part-1-using-the-linq-dynamic-query-library for additional details
See this example for more details
+1 vote
answered Jun 2, 2016 by andra (670 points)
Not saying this is a killer app but it looks like it could be cool Build Where Clause Dynamically in Linq - CodeProject
If you want to do even fancier stuff you should look into reflection
commented Jun 3, 2016 by Vg_It (380 points)
No need to change anything else
commented Jun 4, 2016 by wayment (1,220 points)
I think that this is a problem that will sort itself out overtime

What is Geekub?

Q&A site for professional and enthusiast programmers, software developers and other technical users. With your help, we hope to work together to build a library of detailed answers to just about any question that is related to programming!







...