I guess you have tried removing the <BlogPost> part? That should be inferred from the Children type which is IEnumerable<IPublishedContent>. If you want to cast them to BlogPost you can do:
Model.Parent.Children.Where(x => x.Id == 123).Select(x=> new BlogPost(x));
If you want to filter the children by doctype you can do:
Filtering by dropdown value
Why doesn't below code work?
I get "Type IEnumerable is Defined in an assembly that is not reference.
Top of the page reads:
I am using the v8 compatible notation.
I've tried to follow documentation by appears that the only overload for Where I can use is Where<>(), documentation shows all examples with Where()
https://our.umbraco.com/Documentation/Reference/Querying/IPublishedContent/Collections
Really lost at this point.
I guess you have tried removing the
<BlogPost>
part? That should be inferred from the Children type which isIEnumerable<IPublishedContent>
. If you want to cast them to BlogPost you can do:If you want to filter the children by doctype you can do:
Ok so this turned out to be some sort of .NET Visual Studio issue.
I've Googled the exception what was showing up when debugging the page.
you must add a reference to assembly 'netstandard, version=2.0.0.0, culture=neutral, publickeytoken=cc7b13ffcd2ddd51'.
Solution was to add following to Web.Config
is working on a reply...