Beispiel #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>();
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public BeerTapApiService(IBeerService beerService, IMapper <EF, Model.Beer> toResourceMapper, IMapperFactory mapperFactory)
 {
     _beerService       = beerService;
     _toResourceMapper  = toResourceMapper;
     _toTransportMapper = mapperFactory.Create <Model.Beer, EF>();
 }
Beispiel #4
0
 public EmployeeApiService(IEmployeeService employeeService, IMapperFactory mapperFactory)
 {
     _employeeService  = employeeService;
     _toResourceMapper = mapperFactory.Create <EF, Employee>();
 }
Beispiel #5
0
 public OfficeApiService(IOfficeService officeService, IMapperFactory mapperFactory)
 {
     _officeservice     = officeService;
     _toResourceMapper  = mapperFactory.Create <EF, Office>();
     _toTransportMapper = mapperFactory.Create <Office, EF>();
 }
Beispiel #6
0
 public void Run(int value)
 {
     var mapper = _factory.Create(value);
 }