Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7512905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:00:48+00:00 2026-05-30T00:00:48+00:00

I am looking for a good example projects for using repository pattern and stored

  • 0

I am looking for a good example projects for using repository pattern and stored procedure. I have spent a lot of times,I can’t find any good example that use sp to commmunicate with repository pattern and db. Even a regular CRUD, I will still use SP.

Also, does anyone have an example to do complex data in stored procedure to code in EF?
For example, stored procedure return multiple data tables?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:00:50+00:00Added an answer on May 30, 2026 at 12:00 am

    I can’t find any good example that use sp to commmunicate with
    repository pattern. Even a regular CRUD, I will still use SP.

    Just think about the pattern and your options – you can use only SPs and you want object responsible for data access. You don’t need any example project – you just need to think.

    When implementing repository with stored procedures you will end with simple DAO (data access object) defined by interface like:

    public interface IEntityDao
    {
        IEnumerable<Entity> GetAll();
        Entity GetByKey(int key);
        bool Insert(Entity data);
        bool Update(Entity data);
        bool Delete(int key);
    }
    

    This is basic interface for CRUD operations on Entity persisted class. Every method implementation will call single stored procedure to perform the operation. If you will need any other operation (for example some filtering or ordering) you will create new stored procedure and expose new operation calling this stored procedure.

    There can be discussion if this is or is not repository but simply SPs will not offer you anything more. For example this part of definition is mostly impossible to achieve on generic level:

    Client objects construct query specifications declaratively and submit
    them to Repository for satisfaction.

    Your “query specification” will always be only parameters specific to given stored procedure and passed to your exposed operation. You will not be able to declaratively define whole query (unless you pass SQL as parameter to your SP).

    You can call stored procedures directly by ADO.NET or use either function imports or ExecuteStoreQuery / ExecuteStoreCommand in EF. EF is able to execute complex stored procedures with this limitations:

    • stored procedure returns only single result set. For multiple result sets you will need either EFExtensions or you will have to wait for .NET 4.5 where this feature should be included
    • stored procedure must not return different result set – it means that structure of result set must be the same for each SP execution (no pivots or dynamic SQL returning different number of columns)

    Function imports have few more minor limitations. If you follow these rules you will be able to create classes / complex types for every result set returned by your SP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a good example of storing data in a cookie using ASP.NET.
I'm looking for a good example of using Regular Expressions in PHP to reverse
I'm looking around for a good example to work with TFS 2010 collections,projects, and
I'm looking for a good example that shows how to handle (in the controller)
I am looking for a good example of how to achieve the following: I
I am looking for good methods of manipulating HTML in PHP. For example, the
I'm looking for a good way to install multiple completely different Django projects on
Where can I find some good, proven guidelines or examples on writing extensible, modular,
I'm looking for programs/projects that are small to moderate size that show good modern
I am looking for good real-world examples of IoC in actual .NET software projects

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.