EF4 - Repository Pattern with Stored-Procedure RRS feed

  • Question

  • User1521950836 posted

    Good Morning,

    I need some advice on the best practice for selecting records from a stored procedure through a repository class which implements ObjectContext and ObjectSet. The repository class works fine when querying Entites (of type EntityObject), however as stored procedures cannot be composed, what is the best approach for querying the database using a stored procedure through EF?

    A parameter needs to be passed to the stored procedure which after a successful execution, will return the data in an Entity-Object type format.

    I can call the stored procedure on the EF directly, however I would like to use a single repository pattern which handles all transaction to/from the database.

    Any suggestion, are greatly appreciated.

    Thursday, March 31, 2011 4:36 AM