public KegApiService(IKegService kegService, IMapper <Domain.Model.Keg, Keg> toResourceMapper, IMapperFactory mapper) { _kegService = kegService; _toResourceMapper = toResourceMapper; _toEntityMapper = mapper.Create <Keg, Domain.Model.Keg>(); }
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); }
public BeerTapApiService(IBeerService beerService, IMapper <EF, Model.Beer> toResourceMapper, IMapperFactory mapperFactory) { _beerService = beerService; _toResourceMapper = toResourceMapper; _toTransportMapper = mapperFactory.Create <Model.Beer, EF>(); }
public EmployeeApiService(IEmployeeService employeeService, IMapperFactory mapperFactory) { _employeeService = employeeService; _toResourceMapper = mapperFactory.Create <EF, Employee>(); }
public OfficeApiService(IOfficeService officeService, IMapperFactory mapperFactory) { _officeservice = officeService; _toResourceMapper = mapperFactory.Create <EF, Office>(); _toTransportMapper = mapperFactory.Create <Office, EF>(); }
public void Run(int value) { var mapper = _factory.Create(value); }