Reputation: 225
I have a complex object (returned from a web service api). It has multiple nested items, some of which contain lists of property names & values (key value pairs). for example
a meterdetail class can contain multiple meter objects, each meter object has multiple rows, each row has a key (the property name) and a value (the propertyvalue). I need to map each row to a specific property of a class, so
and so on
is this possible with automapper ? If so, how would I do this ? Im using .netcore 5 and C# Id greatly appreciate some advice
Upvotes: 0
Views: 471
Reputation: 42105
I wouldn't bother. AutoMapper's great for simple 1-1 mappings from one type to another where they look basically the same, but if you did manage to do what you're asking with AutoMapper, you'd just be hiding complex logic in a mapping class away from where things are happening. If it were me, I'd spend the time literally just doing it by hand, instead. You'll thank yourself for it later, I imagine.
Upvotes: 1