Exemple #1
0
        public Startup(IHostingEnvironment env)
        {
            ServicesContainer.AddHostingEnvironment(env);

            Configuration = ServicesContainer.ConfigurationBuilder();

            Log.StartLog();
        }
Exemple #2
0
        public void IniciarMongo()
        {
            BsonDefaults.GuidRepresentation = GuidRepresentation.Standard;

            IHostingEnvironment Environment = new HostingEnvironment();

            ServicesContainer.AddHostingEnvironment(Environment);

            var Configuration = ServicesContainer.ConfigurationBuilder();

            ServicesContainer.AddServices(new Microsoft.Extensions.DependencyInjection.ServiceCollection());

            MongoDbServices.Configure(new MongoDbConfig {
                ConnectionString = "mongodb://*****:*****@draromas.documents.azure.com:10255/?ssl=true&replicaSet=globaldb&connectTimeoutMS=120000&socketTimeoutMS=120000&waitQueueTimeoutMS=120000&maxIdleTimeMS=600000", DBName = "IOTServices"
            });
            //MongoDbServices.Configure(new MongoDbConfig { ConnectionString = "mongodb://*****:*****@gq-test2.cloudapp.net:27017/IOTServices?connectTimeoutMS=120000&socketTimeoutMS=120000&waitQueueTimeoutMS=120000&maxIdleTimeMS=600000&authMechanism=SCRAM-SHA-1", DBName = "IOTServices" });

            ServicesContainer.BuildServiceProvider();
        }
Exemple #3
0
        public void TestConection()
        {
            IHostingEnvironment Environment = new HostingEnvironment();

            ServicesContainer.AddHostingEnvironment(Environment);

            var Configuration = ServicesContainer.ConfigurationBuilder();

            ServicesContainer.AddServices(new Microsoft.Extensions.DependencyInjection.ServiceCollection());

            OracleServiceDBConfiguration.SetConnectionString("Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.246.6.109)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=qhom11)));User Id=trz;Password=trz;")
            .SetAssembly(typeof(GQ_Usuarios).Assembly).SetOption((builder) =>
            {
                builder.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);
                return(builder);
            });

            var service = ServicesContainer.BuildServiceProvider();

            using (var scope = service.GetRequiredService <IServiceScopeFactory>().CreateScope())
            {
                scope.ServiceProvider.GetService <OracleService>().Migrate();
            }
        }