How to build a query like the selectbyexample using linq-to-entities?
For example:
public class Person
{
public string Name {get; set;}
public int Age {get; set;}
public string City {get; set;}
}
If I had a new Person() with all properties with values are null, the query should return me all the records of the Person table.
But if I pass an object with the property Age = 25, the query should return me all records with age = 25;
I would like to build a single query filter to accept any of the properties and if one were to disregard it null.