Reputation: 108
var a = Nodes.Children.Where("CustomProperty == @0", "Value").First();
Throwing error {"No property or field 'CustomProperty' exists in type 'IPublishedContent'"}
Upvotes: 0
Views: 326
Reputation: 2316
You need to use strongly typed models - e.g.:
var a = Nodes.Children<PageType>.Where(p => p.CustomProperty == "Value").First();
There are no dynamics in Umbraco 8 anymore, and the APIs have been simplified. Take a look at Shannon Deminick's "cheat sheet" from the uDuf conference earlier this year:
https://shazwazza.com/media/1032/uduf-2019.pdf
Upvotes: 3