Model.Value on interface model generates error "Property is not marked with ImplementPropertyType attribute"
Ok so I have a Composition Header that is used accross my website.
In my master view template I have a partial called Header.
@inherits Umbraco.Web.Mvc.UmbracoViewPage<IHeader>
var headerPicker = Model.Value(x => x.HeaderPicker, fallback: Fallback.ToAncestors);
This generates following error
Property is not marked with ImplementPropertyType attribute.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Property is not marked with ImplementPropertyType attribute.
The generated Headers model has this tag:
[ImplementPropertyType("headerPicker")]
However the Interface (IHeader) obviously do not, and I'm suspecting this whats causing my issue.
This seems to work fine though:
var headerPicker = Model.Value<IEnumerable<IPublishedContent>>("HeaderPicker", fallback: Fallback.ToAncestors);
Is this a bug in Umbraco, or .net? How do other Umbracians use this?
Reason why I want to use Model.Value is because I want to start using Language fallbacks, is there some other way to use Language Fallbacks with models builder outside of Model.Value?
Model.Value on interface model generates error "Property is not marked with ImplementPropertyType attribute"
Ok so I have a Composition Header that is used accross my website. In my master view template I have a partial called Header.
This generates following error
The generated Headers model has this tag:
However the Interface (IHeader) obviously do not, and I'm suspecting this whats causing my issue.
This seems to work fine though:
Is this a bug in Umbraco, or .net? How do other Umbracians use this? Reason why I want to use Model.Value is because I want to start using Language fallbacks, is there some other way to use Language Fallbacks with models builder outside of Model.Value?
Thank you for any help and pointers!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" button below.
Continue discussion