Пример #1
0
        public SiteViewModel(SiteContainer context, string contentName)
        {
            Title = "Poggenpohl";

            if (contentName != null)
            {
                Content = contentName != ""
                              ? context.Content.First(c => c.Name == contentName)
                              : context.Content.First(c => c.MainPage);
                SeoDescription = Content.SeoDescription;
                SeoKeywords = Content.SeoKeywords;
                IsHomePage = Content.MainPage;
            }
        }
Пример #2
0
 /// <summary>
 /// Create a new Content object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="mainPage">Initial value of the MainPage property.</param>
 public static Content CreateContent(global::System.Int32 id, global::System.String title, global::System.String name, global::System.Boolean mainPage)
 {
     Content content = new Content();
     content.Id = id;
     content.Title = title;
     content.Name = name;
     content.MainPage = mainPage;
     return content;
 }
Пример #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Content EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToContent(Content content)
 {
     base.AddObject("Content", content);
 }