コード例 #1
0
 public KegApiService(IKegService kegService,
                      IMapper <Domain.Model.Keg, Keg> toResourceMapper,
                      IMapperFactory mapper)
 {
     _kegService       = kegService;
     _toResourceMapper = toResourceMapper;
     _toEntityMapper   = mapper.Create <Keg, Domain.Model.Keg>();
 }
コード例 #2
0
ファイル: MapingEngine.cs プロジェクト: saber-wang/nlite
        private static IMapper CreateGenericMapper(Type fromType, Type toType, IMapperFactory fac)
        {
            var mapper = fac.Create(fromType, toType);

            var genericMapperType = typeof(GenericMapper <,>)
                                    .MakeGenericType(fromType, toType);
            var ctor = genericMapperType.GetConstructor(new Type[] { typeof(MapperBase) });

            var genericMapper = (IMapper)ctor
                                .FastInvoke(mapper);

            return(genericMapper);
        }
コード例 #3
0
 public BeerTapApiService(IBeerService beerService, IMapper <EF, Model.Beer> toResourceMapper, IMapperFactory mapperFactory)
 {
     _beerService       = beerService;
     _toResourceMapper  = toResourceMapper;
     _toTransportMapper = mapperFactory.Create <Model.Beer, EF>();
 }
コード例 #4
0
 public EmployeeApiService(IEmployeeService employeeService, IMapperFactory mapperFactory)
 {
     _employeeService  = employeeService;
     _toResourceMapper = mapperFactory.Create <EF, Employee>();
 }
コード例 #5
0
 public OfficeApiService(IOfficeService officeService, IMapperFactory mapperFactory)
 {
     _officeservice     = officeService;
     _toResourceMapper  = mapperFactory.Create <EF, Office>();
     _toTransportMapper = mapperFactory.Create <Office, EF>();
 }
コード例 #6
0
 public void Run(int value)
 {
     var mapper = _factory.Create(value);
 }