Notes: this assumes you now have 2sxc 10.24 or newer running. You can also just start with step one and reload the page, then fix issues step-by step.
Always Required
- Add this to the first line:
@inherits ToSic.Sxc.Dnn.RazorComponent
Note: no semicolon at the end (;). This first line to tells the compiler to use the new base class which enables new features and disables obsolete features.
- Change any @Content.Toolbar to
this also applies to other dynamic objects that use .Toolbar
@Edit.TagToolbar(Content)
- recommended see this
- or
@Edit.Toolbar(Content)
(this behaves the same as the previous one)
Changes for Content-Lists
- Change all ListContent to
Header
The old name ListContent was always confusing, so in RazorComponents we changed it to Header and disabled the use of ListContent.
- Change all ListPresentation or ListContent.Presentation to
Header.Presentation
Changes for Data-Code (LINQ and List-Loops)
- Change all list-uses of AsDynamic(...) to
AsList
(...)
Previously AsDynamic was used both for single-items as well as for lists. The compiler couldn't always figure out what to use, so you had to cast objects - which was nasty. Now you use AsList for lists, and AsDynamic for single items.
See also AsDynamic(...) - Magic Objects and AsList(...) - Magic Lists
- If you ever cast to IEntity, use the new one on
ToSic.Eav.Data.IEntity
- see this
- If you ever had a DynamicEntity cast change that to dynamic - see this
- If you ever had to cast to IEnumerable, prefer...
to use, use
@using Dynlist = System.Collections.Generic.IEnumerable<dynamic>;
to cast it - in the code it will look a bit like this:
(person.Awards as Dynlist).Select(a => a.Name)
Changes to jQuery
For performance reasons jQuery isn't automatically included any more. If your code expects to use jQuery, make sure you tell DNN about it.
Changes to CustomizeData or CustomizeSearch
- Use
Purpose
instead of InstancePurpose
- The signature of CustomizeSearch has slightly different object types - see docs