Closed Ron-Brouwer closed 7 years ago
Thanks @Ron-Brouwer. It would be great to see an example of how this could be implemented.
Since I don't use the ModelsBuilder feature, I'm curious if there'd be any impact in calling the CreateModel
method?
Hi @leekelleher,
There is almost no impact if you check for a used factory. All the factory does is invoke a constructor which is already cached in a dictionary: Func<IPublishedContent, IPublishedContent> constructor; return _constructors.TryGetValue(contentTypeAlias, out constructor) ? constructor(content) : content;
I've implemented it for you in a pull request: "Call the model factory to support typed models when used." https://github.com/umco/umbraco-nested-content/pull/110
Hope you'll use it.
Thanks @Ron-Brouwer - we'll review the PR, (I've had a quick look, seems good 👍).
I'll close this issue, we can have any follow-up on PR #110.
Nice addition for Nested Content Property Value Converter: PublishedContentModelFactoryResolver.Current.Factory.CreateModel(value) That will also solve the issue with multiple types in one nested content