Skip to main content

Delivery API - Nodes

Log in to add to favourites

There 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.

C#
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:

C#
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.

C#
@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

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request