Automapper not mapping entities that are newly added in Entity Framework 4.1 context -
Automapper not mapping entities that are newly added in Entity Framework 4.1 context -
i lazy loading entities , when create initial phone call pull list of entities seeing system.data.entity.dynamicproxies....type. fine , entities map dtos fine. issue having when add together new item context beingness pulled fromt context , not database. so, see list beingness pulled system.data.entity.dynamicproxies types , new item taht actual type of object.
so, illustration may have list this:
system.data.entity.dynamicproxies.contact... system.data.entity.dynamicproxies.contact... system.data.entity.dynamicproxies.contact... mynamespace.contact
i created custom type converter , noticed dynamicproxy types have source value, mynamespace.contact not have source value. so, not getting mapped in type converter.
you can phone call createobject/create
method in objectset/dbset when creating entity without using constructor.
var newcontact = context.contacts.create(); context.contacts.add(newcontact);
the returned object proxy supports lazy loading.
entity-framework-4 automapper
Comments
Post a Comment