Delivery API - Nodes
Log in to add to favouritesThere is a possibility that on upgrade that there may be a conflict between these types if both .NET Delivery API and Contensis WebAPI are referenced within either a Razor view or an AppCode source code file, i.e.
using Zengenti.Contensis.Delivery;
using Contensis.Framework.Web;
If you happen to have a declaration of a Node defined in your code, such as these examples below:
Node current = new NodeFactory().Load("/path/to/webpage.aspx”);
@helper breadcrumb2(Node node)
{
//Helper code here
}
foreach(Node node in collectionOfContent) {
//Code within loops goes here
}
then you will likely see the following error after upgrade:
error CS0104: 'Node' is an ambiguous reference between 'Zengenti.Contensis.Delivery.Node' and 'Contensis.Framework.Web.Node'
In order to resolve this. In most cases you can change the Node type to either a ContentNode or FolderNode type.
If you still need to use the Node type for our WebAPI then you can alias it like so.
@using Node = Contensis.Framework.Web.Node
If you use this approach, you may need to refactor your code at a later date if you wish to start using nodes from SiteView for your navigation