API support

CSOM SSOM

Can be deployed under

Web Site

Notes

Root web provision is enabled via RootWebDefinition object.

There are two cases for which RootWebDefinition could be of use:

  • We need to rename Title/Description of the root web
  • We need to 'lookup' the root web to provision content on root web

If Title/Description are not provided, provision does not change anything.

Both CSOM/SSOM object models are supported.

Examples

Update root web Title/Description

var rootWeb = new RootWebDefinition
{
    Title = "M2 CRM",
    Description = "Custom CRM application build on top of M2 framework."
};

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

DeployModel(model);


                            
Add lists to root web

var rootWeb = new RootWebDefinition
{

};

var model = SPMeta2Model.NewSiteModel(site =>
{
    site.AddRootWeb(rootWeb, web =>
    {
        web
          .AddHostList(BuiltInListDefinitions.StyleLibrary, list =>
          {
              // do stuff with 'Style Library'
          })
          .AddHostList(BuiltInListDefinitions.Catalogs.MasterPage, list =>
          {
              // do stuff with 'Master Page Library'
          });
    });
});

DeployModel(model);