locked
OOP Confusion RRS feed

  • Question

  • User1536465747 posted

    say I have an object Client in the business layer. Then I have ClientRepository with Retrieve and Save methods.
    Finally, I have another data layer project in the same solution whereas for now I store connection object.
    My question is the following:
    Where I open the connection and create command and everything? In each of the ClientRepository methods OR I create an additional kinda DA helper so then i only assign the SP name in the method and get the data?

    Friday, June 23, 2017 5:37 AM

Answers

  • User2119946224 posted

    Hello,

    You can create one separate layer which will manage all your connection, command and transaction operation. You just need to pass stored procedure information and parameter which needs for executing procedure. This way you can use this layer in your multiple projects.

    Regards,

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 23, 2017 5:13 PM