Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Latest commit

 

History

History
39 lines (29 loc) · 1.06 KB

README.md

File metadata and controls

39 lines (29 loc) · 1.06 KB

DbRepoProvider

DB Repository Provider

Database Repository Helper with UnitOfWork back-end implementation.

  • .Net Framework version: 4.5

  • Requirements:

    • ^EntityFramework 6.1.3
    • Oracle DB

Usage:

  1. Add reference to DBRepoProvider.dll
  2. Start using your helper:
      static void Main(string[] args)
      {
          using (var context = new Entities())
          {
              //Initialize your dbRepoProvider
              var dbRepoProvider = new UnitOfWork<Entities>(context: context, autoCommit: false);

              //Example with Linq
              var x = from r in dbRepoProvider.Context.TABLE
                      select r;

              //CRUD
              var table = dbRepoProvider.GetRepository<TABLE>().GetByID(1);

              //Procedure
              var proc = dbRepoProvider.ExecuteProcedure<CXT_TYPE>("PROCEDURE", arg1, arg2, arg3, ...);

              //Function
              var func = dbRepoProvider.ExecuteFunction("FUNCTION", arg1, arg2, arg3, ...);
          }
      }