Skip to content

MapProperty on collections seem impossible #1030

Closed Answered by TimothyMakkison
JKetelaar asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, sorry to hear your stuck, 2/3 would be the recommended way of handling your issue. Unfortunately the function signatures are invalid.

  1. Using MapProperty
[MapProperty("MyClass.OtherItems.Name", "MyViewClass.ViewItems.SomeName")]

This won't work for two reasons.

Firstly the member path is invalid as you have specified the type of the source and taget objects (MyClass & MyViewClass) therefore mapperly will look for members of the name MyClass inside MyClass.

Secondly OtherItems and ViewItems are enumerable so its not possible to map Name and SomeName, what you've done in 2. and 3. is the correct way to handle enumerables.

  1. Using a custom method on the collection

It looks like you'…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@JKetelaar
Comment options

Answer selected by JKetelaar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants