Skip to content

2.0 Migration

ahmad.shahid edited this page Nov 3, 2022 · 1 revision

Migrating to 2.0

Please note that using Visual Studio, 2017 or later is required to add the .Net Standard NuGet dependencies (#356). See the Microsoft documentation.

Breaking Changes

Core.cs -> Model.cs

The Core class has been renamed to Model to better reflect its use and differentiate it from the naming ".NET Core".

The properties in the MVC and WebForms project for interacting with this class have also been updated to reflect this change. WebTemplate[-Core-] to WebTemplate[+Model+].

HttpCurrent.Request

System.Web.HttpRequest is being switched to using Microsoft.AspNetCore.Http.HttpRequest

Properties

JSONSerializationObjects

The GoC.WebTemplate.Components.JSONSerializationObjects namespace has moved to GoC.WebTemplate.Components.Entities

Custom object constructors have been removed. Please use the new C# method for initialization.

\\old
new Breadcrumb("http://www.canada.ca/en/index.html", "Home", "")
\\new
new Breadcrumb { Href = "http://www.canada.ca/en/index.html", Title = "Home" }

Obsolete properties

All obsolete properties have been removed.

Settings properties

The following properties have moved under .Settings in the Model. There is no change to how they are set in the web.config.

  • SignOutLinkUrl
  • SignLinkUrl
  • CustomSiteMenuUrl
  • SessionTimeout
  • LeavingSecureSiteWarning
  • Version
  • Environment
  • LoadScriptsFromGoogle
  • ShowPreContent
  • ShowPostContent
  • FeedbackLink
  • ShowSearch
  • ShowSharePageLink
  • ShowLanguageLink
  • UseHttps
  • StaticFilesLocation

Pointer properties removed

Any property that was only pointing to another property was removed.
Including:

  • CurrentEnvironment -> CdtsEnvironment
  • CDNEnvironment -> CdtsEnviornment.CDN
  • WebTemplateTheme -> CdtsEnviornment.Theme
  • CDNURL -> CdtsEnviornment.Path
  • LocalPath -> CdtsEnviornment.LocalPath
  • WebTemplateSubTheme -> CdtsEnviornment.SubTheme
Render pointers removed

All render functions that were pointing to the Render class have been removed and are now accessible though Render.

Feedback links merged

All related feedback link properties have been merged into the FeedbackLink class.

  • ShowFeedback -> Settings.FeedbackLink.Show
  • FeedbackLinkUrl -> Settings.FeedbackLink.Url
  • FeedbackLinkUrlFr -> Settings.FeedbackLink.UrlFr

SocialMediaSites

SocialMediaSites is now under GoC.WebTemplate.Components.Entities and not part of the "Core/Model"

MenuSection

Property names have been updated for consistency with other link properties

  • [-Name-] -> [+Text+]
  • [-Link-] -> [+Href+]
  • [-OpenInNewWindow-] -> [+NewWindow+]

MenuItem

SubItems is now a List<Link> as you can't have continual layers of menus. Max is 3 (MenuSection -> MenuItem -> Link).

CustomFooterLinks

Has been changed to only accept a List<FooterLink>

New Project Structure

GoC.WebTemplate.sln

  • GoC.WebTemplate.Components
  • [+GoC.WebTemplate.Components.Framework+] -> Inherits from GoC.WebTemplate.Components
  • [+GoC.WebTemplate.Components.Core+] -> Inherits from GoC.WebTemplate.Components
  • [+GoC.WebTemplate.Components.CoreMVC+] -> Inherits from [+GoC.WebTemplate.Components.Core+]
  • GoC.WebTemplate.Components.MVC -> Inherits from [+GoC.WebTemplate.Components.Framework+]
  • GoC.WebTemplate.Components.WebForms -> Inherits from [+GoC.WebTemplate.Components.Framework+]