예제 #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            var dbConfig = new DocumentDbConfigBuilder(
                "https://localhost:8081",
                "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==")
                           .Finish();

            // services.AddNebula("Florist", dbConfig);
            services.AddNebula("Florist", Configuration);

            services.AddScoped <FlowerStore>();
        }
예제 #2
0
        protected override DocumentDbConfig GetConfig()
        {
            var builder = new DocumentDbConfigBuilder(_config.ServiceEndpoint, _config.AuthKey);

            if (_config.DatabaseId != null)
            {
                builder.SetDatabaseId(_config.DatabaseId);
            }

            if (_config.CollectionName != null)
            {
                builder.SetCollectionName(_config.CollectionName);
            }

            if (_config.DefaultRus.HasValue)
            {
                builder.SetDefaultRus(_config.DefaultRus.Value);
            }

            return(builder.Finish());
        }