コード例 #1
0
        public void Can_Provision_Incrementally_With_AutoDetection_As_CSOM()
        {
            var provisionRunner  = new O365ProvisionRunner();
            var provisionService = provisionRunner.ProvisionService;

            var incrementalProvisionConfig = new IncrementalProvisionConfig();

            incrementalProvisionConfig.AutoDetectSharePointPersistenceStorage = true;

            provisionService.SetIncrementalProvisionMode(incrementalProvisionConfig);

            provisionRunner.SiteUrls.ForEach(siteUrl =>
            {
                var incrementalModelId = "m2.regression." + Guid.NewGuid().ToString("N");

                var model = SPMeta2Model.NewSiteModel(site =>
                {
                });

                model.SetIncrementalProvisionModelId(incrementalModelId);

                provisionRunner.WithO365Context(siteUrl, context =>
                {
                    provisionService.DeployModel(SPMeta2.CSOM.ModelHosts.SiteModelHost.FromClientContext(context), model);
                });
            });

            provisionRunner.WebUrls.ForEach(siteUrl =>
            {
                var incrementalModelId = "m2.regression." + Guid.NewGuid().ToString("N");

                var model = SPMeta2Model.NewWebModel(site =>
                {
                });

                model.SetIncrementalProvisionModelId(incrementalModelId);

                provisionRunner.WithO365Context(siteUrl, context =>
                {
                    provisionService.DeployModel(SPMeta2.CSOM.ModelHosts.WebModelHost.FromClientContext(context), model);
                });
            });
        }
コード例 #2
0
        public void Can_Provision_Incrementally_With_NoIncrementalModelId()
        {
            var provisionRunner  = new O365ProvisionRunner();
            var provisionService = provisionRunner.ProvisionService;

            var incrementalProvisionConfig = new IncrementalProvisionConfig();

            incrementalProvisionConfig.PersistenceStorages.Add(new DefaultFileSystemPersistenceStorage());

            provisionService.SetIncrementalProvisionMode(incrementalProvisionConfig);

            provisionRunner.SiteUrls.ForEach(siteUrl =>
            {
                var model = SPMeta2Model.NewSiteModel(site => { });

                provisionRunner.WithO365Context(siteUrl, context =>
                {
                    provisionService.DeployModel(SPMeta2.CSOM.ModelHosts.SiteModelHost.FromClientContext(context), model);
                });
            });
        }