Which collection structure I should use for parametrical grouping ordering in c#?
<p>I have various windows forms applications that contain various controls that build up custom "group by" and "where" clauses for my class methods.</p>

<p>I am thinking to pass a collection structure of some kind in order for the methods to be able to build the group by's and the where clauses. </p>

<p>Let's say a list containing the field and the value for the group by or where.</p>

<p>Am I going to the right direction?</p>

<p>Update:</p>

<p>I dont have code yet but let me try to explain better:</p>

<ol>
<li>We have a form with 10 dropdownlists and a checkmark beside them.</li>
<li>Also we have adatagrid on the form.</li>
<li><p>Every dropdownlist corresponds to a field in a table.</p>

<ul>
<li><p>If a dropdownlist has its checkbox checked means that it must be part of the group by clause in the select statement.</p></li>
<li><p>The value of the dropdownlist must be part of the where clause.</p></li>
</ul></li>
</ol>

<p>*<strong>note: *</strong>  Another application could have different numbers of dropdownboxes and different corresponding fields.</p>

<p>I want to create a common method that will retrieve data with user selectable group by and where clauses.</p>

<p>So what i think is to pass to the method 2 lists.</p>

<ul>
<li><p>One with (fieldname, value) for the where clauses</p></li>
<li><p>And one with (fieldname) for the group by</p></li>
</ul>

<p>depending on the logic above...</p>

<p>I hope this is more clear.</p>
