|
Reflections of my life.
Browse by Tags
All Tags » Linq ( RSS)
-
|
Today I was approached with a nice question. Suppose we have a simple class with a few properties. We want to do a linq query over it with a where clause. (it doesn’t matter what is the data source, in this case it will be plain CLR objects). Let’s say that we want to construct our Where clause in such a matter that if a variable is null we ignore it and use another condition, but if it is not null we will use this one; did I confuse you? let’s try to look on an example: First we will create our...
|
|
|
|