public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables(); Configuration = builder.Build(); ConfigureMap.Configure(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc(); //TODO configurar conection var connection = @"Server=(LocalDb)\MSSQLLocalDB;Database=TrocoBrq;Trusted_Connection=True;MultipleActiveResultSets=true"; services.AddDbContext <CoreContext>(options => options.UseSqlServer(connection)); ConfigureMap.Configure(); // Inject Dependencies. DIContainer.RegisterDependencies(services); }
public Startup(IHostingEnvironment env) { var basePath = Directory.GetCurrentDirectory(); var applicationPath = Directory.GetCurrentDirectory() + "//"; var builder = new ConfigurationBuilder() .SetBasePath(basePath) .AddJsonFile("connectStrings.json", false, true) .AddJsonFile(applicationPath + $"appsettings.json", optional: false, reloadOnChange: true).AddEnvironmentVariables(); Configuration = builder.Build(); _environmentName = env.EnvironmentName; ConfigureMap.Configure(); //autoMapper }
public Startup(IHostingEnvironment env) { var BasePath = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"..\_config\")); if (env.IsDevelopment()) { BasePath = Directory.GetCurrentDirectory(); } var builder = new ConfigurationBuilder() .SetBasePath(BasePath) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables(); Configuration = builder.Build(); _env = env; _environmentName = env.EnvironmentName; ConfigureMap.Configure(); //autoMapper }
public BaseFixture() { ConfigureMap.Configure(); }
public Startup(IConfiguration configuration) { Configuration = configuration; ConfigureMap.Configure(); }