Ejemplo n.º 1
0
 public static void Init(CustomConfiguration customConfiguration)
 {
     LogUtility.Log("MongoHelper init start");
     _connectionString = Environment.GetEnvironmentVariable(Constants.MongoDbConnectionStringEnv) ?? customConfiguration.MongoDBConnectionInfo.ConnectionString;
     _database         = Environment.GetEnvironmentVariable(Constants.MongoDbDatabaseEnv) ?? customConfiguration.MongoDBConnectionInfo.Database;
     _collection       = Environment.GetEnvironmentVariable(Constants.MongoDbCollectionEnv) ?? customConfiguration.MongoDBConnectionInfo.Collection;
     _mongoClient      = new MongoClient(_connectionString);
     CheckConnectionLoop();
     LogUtility.Log("MongoHelper init end");
 }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            IConfiguration Configuration;
            var            builder = new ConfigurationBuilder().AddJsonFile($"appsettings.json", true, true);

            Configuration        = builder.Build();
            _customConfiguration = new CustomConfiguration();
            Configuration.GetSection("CustomConfiguration").Bind(_customConfiguration);

            BikesHelper.Init(_customConfiguration);
            BillingHelper.Init(_customConfiguration);
            MongoHelper.Init(_customConfiguration);

            var host = WebHost.CreateDefaultBuilder <Startup>(args).Build();

            host.Run();
            LogUtility.Log("Reservation engine service running.");
        }
Ejemplo n.º 3
0
 public static void Init(CustomConfiguration customConfiguration)
 {
     LogUtility.Log("BillingHelper init start");
     _billingService = Environment.GetEnvironmentVariable(Constants.BillingMicroserviceEnv) ?? customConfiguration.Services.Billing;
     LogUtility.Log("BillingHelper init end");
 }