views:

38

answers:

0

Currently, I have a set of stored procedures which are called to populate different fields on a page. I am calling the stored procedures from the LINQ to SQL class that I dropped them on, which works fine. However, it automatically generates (StoredProcedureName)Result class names which I have to work with.

Is there anyway to take a stored procedure and bind the result to multiple classes? For example I have a stored procedure that gets the information for a blog post. I want to bind that data into a Post class and a User class (for the author), however I am not retrieving all of the data from the stored procedure to fill an entire Post object or User object (the stored procedure only returns the title, content, and author name).

What is the best way to handle this scenario? I am open to changing the stored procedure but I would rather not have to return data that I am not going to use just to populate a full object and I cannot use LINQ to SQL to query the database.