0
votes

I have been following these examples in a previous stack overflow example, I need to convert to an Integer id to an Azure mobile app, and need a MappingDomainManager class described by user Kiske1 in the post below.

Azure Mobile App using existing database

However, I have been unable to complete this as Automapper.impl.PropertyAccessor is “Type of namespace Impl does not exist…” I am using the latest Automapper dll v6.1.1.0.

Does anyone know where PropertyAccessor has been moved to/or replaced with? Also, both examples that were specified in this post are from 2014, does anyone know of a more up to date walkthrough and preferably an example project?

1

1 Answers

0
votes

Does anyone know where PropertyAccessor has been moved to/or replaced with?

I searched at AutoMapper project and found that PropertyAccessor has been removed. Also, I checked my mobile app project and the Automapper version is 3.3.1, the PropertyAccessor exists and the old sample could work. I assumed that you could try to downgrade the version of your Automapper to fix this issue.

does anyone know of a more up to date walkthrough and preferably an example project?

For Automapper 6.1.1, the usage for FindTypeMapFor method and the parameter type for GetExistingPropertyMapFor method have changed, you could modify your code under SimpleMappedEntityDomainManager as follows:

var m = Mapper.FindTypeMapFor<TModel, TData>();
m.GetExistingPropertyMapFor(new PropertyAccessor(typeof(TData).GetProperty("Id")));

To

var m = Mapper.Configuration.FindTypeMapFor<TModel, TData>();
m.GetExistingPropertyMapFor(typeof(TData).GetProperty("Id"));

Moreover, you could refer to adrian hall's book about The Domain Manager.