In my Startup.cs
class I have the following config build which initializes the db context:
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", true, true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json",true)
.AddEnvironmentVariables();
Configuration = builder.Build();
NHibernateUnitOfWork.Init(Configuration["ConnectionStrings:OracleConnection"]);
NHibernateUnitOfWork
is located in a different project as a class library project. I want to be able to inject (or somehow pass the settings) instead of using the NHibernateUnitOfWork.Init
in my Startup.cs
class.
I can build the appsettings in my class library but trying to avoid that.
What is a sane way to do this ?