We have an object
public class SomeObject
{
public Name {get;set;}
public City {get;set;}
public State {get;set}
//various other parameters. Let's say there's ~20
}
Is it possible to dynamically create new LINQ queries without recompilation of source code? Instead, the query parameters come from an XML structure that is stored and updated in the database.
var result = from i in someObj
where
//XML requests Name = 'Bob'...so append this where clause
name = 'Bob'
Can this be done?
Name = 'Bob' || Name = 'Fred'
. Are conditions only combined with &&?Name = 'Bob' && State = 'OH'
. Or can the conditions be combined with ||?Name = 'Bob' || State = 'OH'
. All of these need to be taken into account before a solution can be proposed.Name = 'Bob'
seems to imply). It’s stupid and unhelpful that someone is finding it fit to go round and downvote all answers that did not infer this missing information.