I am converting a v7 to v8 and in v7, it has a nested content which I have been able to recreate in v8 and it shows up in backoffice with no issues. But when I try to access it through code as follows:
var items = Model.Value<IEnumerable<Umbraco.Core.Models.PublishedContent.IPublishedElement>>("newArticles");
I am getting this error: System.NullReferenceException: Object reference not set to an instance of an object.
Doing this:
var hasArticles = Model.HasValue("newsArticles");
hasArticles returns true
What could be the issue?
I see this error too:
Object reference not set to an instance of an object.]
Umbraco.ModelsBuilder.Umbraco.PureLiveModelFactory.CreateModelList(String alias) in D:\d\Zbu ModelsBuilder\src\Umbraco.ModelsBuilder\Umbraco\PureLiveModelFactory.cs:134
nested content through code
I am converting a v7 to v8 and in v7, it has a nested content which I have been able to recreate in v8 and it shows up in backoffice with no issues. But when I try to access it through code as follows:
I am getting this error: System.NullReferenceException: Object reference not set to an instance of an object.
Doing this:
hasArticles returns true
What could be the issue?
I see this error too:
Object reference not set to an instance of an object.] Umbraco.ModelsBuilder.Umbraco.PureLiveModelFactory.CreateModelList(String alias) in D:\d\Zbu ModelsBuilder\src\Umbraco.ModelsBuilder\Umbraco\PureLiveModelFactory.cs:134
is working on a reply...