2
我註冊automapper使用與以下單位:帶有Unity的Automapper - 在哪裏放置CreateMap的東西?
container
.RegisterType<AutoMapper.Configuration, AutoMapper.Configuration>(new PerThreadLifetimeManager(),
new InjectionConstructor(typeof (ITypeMapFactory), AutoMapper.Mappers.MapperRegistry.AllMappers()))
.RegisterType<ITypeMapFactory, TypeMapFactory>()
.RegisterType<IConfiguration, AutoMapper.Configuration>()
.RegisterType<IConfigurationProvider, AutoMapper.Configuration>()
.RegisterType<IMappingEngine, MappingEngine>();
這工作得很好,但我在哪裏把我Mapper.CreateMap的相當於?
另外,如果我有一些自定義解析器,我如何以及在哪裏註冊這些地方,他們對我通過Unity註冊的其他對象有依賴關係?
你有這樣的例子嗎? – retslig 2012-12-19 21:10:47