Generic interface as a method parameter and seeing fields
<p>This is probably my naivety showing through, but anyway...</p>

<p>I have a generic interface which defines a set of standard methods (implemented differently) across implementations.</p>

<p>I pass the interface into a method as a parameter, this method being responsible for persisting to a database. E.g. I have some implementations called bug, incident, etc, defined from the generic interface (called IEntry). These concerete implementations also make use of IEnumerable</p>

<p>Because a bug is different to an incident, there are different fields. When I pass the interface into a method as a parameter, is there any way to inference the type? So if I pass in the Bug object, I can use its fields, which are not the same fields as in those of Incident. These fields are useful for the persistance to the database. I'm assuming no because there is no way to know what the type to be passed in will be (obviously), but I know people here have more wisdom. In that case, is there a better way of doing things? Because of the similarity, I would like to stick to interfaces.</p>

<p>EDIT: I guess the other way is to make use of some flow control to generate the sql statement on the fly and then pass it in as a parameter.</p>

<p>Thanks</p>
