Replies: 4 comments
-
If the properties of the content item map to the ones of the view model yes. But it looks like it's not the case. If you look at the json representation of your content item it will be clear why. |
Beta Was this translation helpful? Give feedback.
-
I did try to match my model with the content Item and still I'm getting a null result with
here is the contentItem
my model
|
Beta Was this translation helpful? Give feedback.
-
@sebastienros : my goal hear is to Map the ContentItem to my MemberModel. Is there a proper way to do it in OC? |
Beta Was this translation helpful? Give feedback.
-
Most of it should be doable without any code at all, just by using existing fields and parts. If you want to create a custom part, then you you shouldn't use any You can mix a custom editor and other fields though, in that case your Migration will add some fields to your part. But my suggestion would be to only use dynamic fields and parts in a custom content type. |
Beta Was this translation helpful? Give feedback.
-
Is it Possible to convert ContentItem to a given Type?
I'm trying to use this code
var model = memberContentItem.As<MembersEntryViewModel>()
where memberContentItem is of type ContentItem.
MembersEntryViewModel is same model that was use to save the content item using the following code:
There is no error but I'm getting a null result.
Beta Was this translation helpful? Give feedback.
All reactions