I'm trying to update the AutoMapper NuGet package to a newer version. It looks like IMappingEngine
, MappingEngine
, and ConfigurationStore
have been removed and all are throwing a "not defined" error.
Potentially IMapper
can replace IMappingEngine
? But I'm not sure what the replacement is for ConfigurationStore
as I can't find any documentation on this. How do I update my code below?
Private Shared _mapper As IMappingEngine
Private Shared _configurationStore As ConfigurationStore
Private Shared Function AutoMapper() As IMappingEngine
SyncLock GetType(ModelService)
If _mapper Is Nothing Then
_configurationStore = New ConfigurationStore(New TypeMapFactory(), MapperRegistry.Mappers)
_configurationStore.AddProfile(_profile)
_mapper = New MappingEngine(_configurationStore)
Dim typeMaps = _configurationStore.GetAllTypeMaps()
For Each map In typeMaps
_typeMapDictionary(map.SourceType) = map.DestinationType
Next
End If
End SyncLock
Return _mapper
End Function