Skip to content

Provides a generic Mendz.Data-aware context for ADO.Net-compatible access to Oracle databases.

License

Notifications You must be signed in to change notification settings

etmendz/Mendz.Data.Oracle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mendz.Data.Oracle

Provides a generic Mendz.Data-aware context for ADO.Net-compatible access to Oracle databases. Wiki

Namespace

Mendz.Data.Oracle

Contents

Name Description
OracleDbDataContext Provides the database context for an Oracle database.
OracleDataSettingOption Provides the data setting options for Oracle access.

OracleDbDataContext

Mendz.Data.Common defines an IDbDataContext interface, which is implemented as GenericDbDataContextBase, which is derived by DbDataContextBase. OracleDbDataContext derives from DbDataContextBase, which requires the abstract BuildContext() method to be implemented. The internal implementation uses Mendz.Data.DataSettingOptions to build the data context using OracleDataSettingOption.Name.

OracleDbDataContext assumes that appsettings.json contains an entry/section for DataSettings.

{
    "DataSettings": {
        "ConnectionStrings": {
            "OracleConnectionString" : "connection string to Oracle"
        }
    }
}

In the application startup or initialization routine, the DataSettings should be loaded into DataSettingOptions as follows:

        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
            DataSettingOptions.Initialize(Configuration.GetSection("DataSettings").Get<DataSettings>());
        }

Mendz.Data-aware repositories implement DbRepositoryBase, which expects a Mendz.Data-aware data context. Using OracleDbDataContext, a repository skeleton can look like the following:

    public class TestRepository : DbRepositoryBase<OracleDbDataContext>
    {
        ...
    }

Using Mendz.Data can shield the application from "knowing" about the data context. The application does not need to reference Mendz.Data.Oracle. The application can reference only Mendz.Data, and the models and repositories libraries.

NuGet It...

https://www.nuget.org/packages/Mendz.Data.Oracle/

About

Provides a generic Mendz.Data-aware context for ADO.Net-compatible access to Oracle databases.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages