Closed tompipe closed 7 years ago
@tompipe Thanks for the PR, it's very much appreciated! We'll review as soon as we can. 👍
No probs - I had the code in one of my solutions anyway, I've just cleaned and adapted it to fit in with the NC converter.
Should probably caveat it, and say it probably needs testing in other solutions, with/without models builder - it works great for me here though :)
If you get a unit test project added, I'll add some tests when I get some time
Closing the PR, as the Umbraco core version of NC will natively support ModelBuilder / strongly-typed models for NC.
For the package version of NC, we have merged in PR #110 for the v0.5.0 release, which gives initial support for strongly-typed IPublishedContent
models.
Updated the value converter to pass IPublishedContent through the model builder factory (if enabled), which will create strongly typed models. This will allow .OfType<> etc to work
Also implemented the IPropertyValueConverterMeta interface, which allows control over the return type, so for nested content properties where only one doctype is used as the blueprint, the converter will return the type for that strongly typed model, and models builder will use that when generating models
See https://github.com/umco/umbraco-nested-content/issues/118