Replies: 7 comments
-
Hi Devon, |
Beta Was this translation helpful? Give feedback.
-
Similarly, we'd also like to Map an array or list of integer Ids.
|
Beta Was this translation helpful? Give feedback.
-
The mapper is entirely customizable, you can write your own mapping routines. I'm planning to extend it even more, by adding the posibility to specify a mapper, or lambda, to a specific member of a type pair. On the other hand... I see that you are working with Keys and FKs.. Not sure if suits your needs but for these cases I usually create a type containing only the key, and call it Reference, Identity or something like that. So that a DTO property can be a Please take a look at Foreing Keys article on the wiki, maybe it helps. Also it's quite easy to adapt your frontend controls/forms to wrap Ids in an object to make it work with this Reference pattern. |
Beta Was this translation helpful? Give feedback.
-
Another clarification that might be oportune for this discussion. I made this library to quickly map DTOs (and even dictionaries) to Entities so people stops being afraid of creating the right objects for the corresponding layers. The idea is to keep it in a convention-over-configuration way, matching by property name and mapping similiar kind of structures, while keeping it open for modification (so that you can inject your own mapper at any point). I'm trying to walk away from the path of AutoMapper, don't want to add so many mapping options and configurations because:
|
Beta Was this translation helpful? Give feedback.
-
There was a large refactor for 7.2 that allows me to implement this feature easily for both maps and projections |
Beta Was this translation helpful? Give feedback.
-
Map keys to entities is out in 8.0.1. I still need to make it work for projections and write the documentation. |
Beta Was this translation helpful? Give feedback.
-
Seems to work in both ways.. here and here |
Beta Was this translation helpful? Give feedback.
-
I’m wanting to be able to project a query of an aggregated collection to an array or list of the integer primary keys. Listed below are the options I’ve tried. (I'd also like to use List to apply the updated aggregate to the database.)
I get an error “Object reference not set to an instance of an object”. I assume the library doesn’t natively support this? (Or maybe I’m doing something wrong.)
Can a custom extension be made to handle this? If so, can you point me in the right direction?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions