 <p>I know I'm way late to this party but, I think I understand this request to mean that you just want to pass in some properties and generate your query based on those dynamic properties.</p> <p>with the code below I can use any Type and then just populate and pass in an object of that Type with a few values set (I call this my query object), and the query will be generated to go find objects that match the values that you set in your query object.</p> <p>*be careful of bools and things that have default values. </p> <p><strong>Dynamic Query Example</strong></p> <pre><code> public IEnumerable&lt;T&gt; Query&lt;T&gt;(T templateobject) { var sql = "SELECT * From " + typeof(T).Name + " Where "; var list = templateobject.GetType().GetProperties() .Where(p =&gt; p.GetValue(templateobject) != null) .ToList(); int i = 0; Dictionary&lt;string, object&gt; dbArgs = new Dictionary&lt;string, object&gt;(); list.ForEach(x =&gt; { sql += x.Name + " = @" + x.Name; dbArgs.Add(x.Name, x.GetValue(templateobject)); if (list.Count &gt; 1 &amp;&amp; i &lt; list.Count - 1) { sql += " AND "; i++; } }); Debug.WriteLine(sql); return _con.Query&lt;T&gt;(sql, dbArgs).ToList(); } </code></pre> <p><strong>Usage</strong></p> <p>*repo is the class that contains the above function</p> <pre><code>var blah = repo.Query&lt;Domain&gt;(new Domain() { Id = 1, IsActive=true }); </code></pre> <p><strong>Output</strong></p> <pre><code>SELECT * From Domain Where Id = @Id AND IsActive = @IsActive </code></pre> <p>then it spits out any "Domains" that match the above query.</p>