MS Israel Community

Building a community
Welcome to MS Israel Community Sign in | Join | Help
in Search

Ariel's Remote Data Center

Reflections of my life.

Browse by Tags

All Tags » Linq (RSS)
  • Cool LINQ trick

    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...
    Posted Dec 22 2008, 07:31 PM by Ariel Ben Horesh with | with no comments
    תגים:, , ,
Powered by Community Server (Commercial Edition), by Telligent Systems