SenseNet.Portal.Site.Save C# (CSharp) Method

Save() public method

Saves the Site instance.

This is an overriden method, which calls its base implementation first to persist the Site instance, and then rebuilds the site list and sends an application message to the other applications forcing them to do that too.

public Save ( ) : void
return void
		public override void Save()
		{
            RefreshUrlList();

            if (this.CopyInProgress)
            {
                //we need to reset these values to avoid 
                //conflict with the source site
                this.UrlList = new Dictionary<string, string>();
                this.StartPage = null;
            }
            else
            {
                ValidateUrlList();
            }

			base.Save();
            
            var action = new PortalContext.ReloadSiteListDistributedAction();
            action.Execute();
		}

Same methods

Site::Save ( SavingMode mode ) : void

Usage Example

コード例 #1
0
ファイル: SiteTest.cs プロジェクト: maxpavlov/FlexNet
 public void Site_SiteUrl_Insert()
 {
     var originalSite = new Site(Repository.Root);
     originalSite.UrlList.Add("mytestinterneturl", "Forms");
     var originalSiteUrlList = originalSite.UrlList;
     originalSite.Save();
     var site = Node.Load<Site>(originalSite.Id);
     var b = site.UrlList.Count == originalSiteUrlList.Count;
     originalSite.ForceDelete();
     Assert.IsTrue(b, "Site url list are NOT equal.");
 }
All Usage Examples Of SenseNet.Portal.Site::Save