Given a query like:
SELECT table1.field1 FirstField, table2.field2 SecondField
FROM table1
INNER JOIN table2 ON table1.FK = table2.PK
WHERE table1.somefield = 'somevalue';
My objective is to return a strongly typed result set using .netTiers. I assume that I cannot use a view because the WHERE
clause needs a parameter, which cannot be passed to a view. A stored procedure can be passed the 'somevalue' parameter but returns a weakly typed DataSet
or DataReader
.
I figure I'm just missing a concept here. Just to be clear, what I'd like to end up with is to be able to write something like this:
TList <some-entity-name> entityList = DataRepository.SomeProvider.Get( "somevalue" );
foreach ( some-entity-name entity in entityList ) {
DoSomethingWith( entity.FirstField, entity.SecondField );
}
I'd like to avoid a solution that involves a server-side filter after the query has executed; the tables involved are very large.