Automapper with OData (IDelta) support -> Patch method

635 views
Skip to first unread message

Vladimir Gisser

unread,
Sep 27, 2014, 6:29:24 AM9/27/14
to automapp...@googlegroups.com
hi,
i have an azure mobile service.

The patch method (update an entity) has the following signature:
   public async  Task<EntityDto> PatchEntity(string id, Delta<EntityDto> patch)

what is the correct way to convert from Delta<EntityDto> to Delta<Entity> 

thanks,



     

Jimmy Bogard

unread,
Sep 29, 2014, 9:24:06 AM9/29/14
to automapper-users
So today, I don't support open generics, so you'd need to create a type converter for that one and any others:

CreateMap<Delta<EntityDto>, Delta<Entity>>().ConvertUsing(src => Mapper.Map<EntityDto, Entity>(src));

--
You received this message because you are subscribed to the Google Groups "AutoMapper-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automapper-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jon.hu...@gmail.com

unread,
Nov 29, 2017, 9:59:24 AM11/29/17
to AutoMapper-users

@Jimmy Bogard - I tried using your code to convert the Delta but unfortunately I am getting the above error.  I was wondering if you could point me in the right direction to resolve this?  I was thinking about taking in a DTO objert and then manually converting it to a Delta.  Any direction or advice would be greatly appreciated.  I understand you are a busy guy, so thank you in advance for any time you feel you can devote to helping me.

Jimmy Bogard

unread,
Nov 29, 2017, 10:52:47 AM11/29/17
to automapper-users
Well today I do support open generics :)

To unsubscribe from this group and stop receiving emails from it, send an email to automapper-users+unsubscribe@googlegroups.com.

jon.hu...@gmail.com

unread,
Nov 29, 2017, 12:47:41 PM11/29/17
to AutoMapper-users
Thank you so much for the response. I am stoked to hear this!  If you are ever in the domain area for lunch, I would gladly buy you a beer.  Thank you again for your amazing work with AutoMapper!

Jimmy Bogard

unread,
Nov 29, 2017, 2:06:45 PM11/29/17
to automapper-users
Ha! I work down at Jollyville and Braker

To unsubscribe from this group and stop receiving emails from it, send an email to automapper-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages