Exemple #1
0
        public EmployeeContext CreateDbContext(string[] args)
        {
            //DI is not aailable at the time of design thereofore we are not abke to inject parameters here like we did for CompanyRules
            var config  = ConfigurationSettings.GetConfiguration(Directory.GetCurrentDirectory() + "\\..\\Api");
            var builder = new DbContextOptionsBuilder <EmployeeContext>();

            builder.UseSqlServer(ConfigurationSettings.GetDbConnectionString(config));

            return(new EmployeeContext(builder.Options));
        }
 private static void SetupConfiguration(WebHostBuilderContext ctx, IConfigurationBuilder builder)
 {
     ConfigurationSettings.GetConfiguration(Directory.GetCurrentDirectory());
 }