public NumeralService(INumeralRepository numeralRepository, IUnitOfWork unitOfWork, IMapper mapper, MapperConfiguration configMapper) { _numeralRepository = numeralRepository; _unitOfWork = unitOfWork; _mapper = mapper; _configMapper = configMapper; }
private void RegisterConverters(ContainerBuilder builder) { builder.Register(c => { INumeralRepository repository = c.Resolve <INumeralRepository>(); return(new ConverterStrategy( repository.GetRomanToArabicMap(), repository.GetArabicToRomanMap())); }) .As <IConverterStrategy>() .SingleInstance(); }
private void RegisterProductDependencies(ContainerBuilder builder) { builder.Register(c => { INumeralRepository repository = c.Resolve <INumeralRepository>(); return(new ProductCategorizer( repository.GetIntergalacticProducts(), repository.GetEarthyProducts())); }) .As <IProductCategorizer>().SingleInstance(); builder.RegisterType <ProductHelper>() .As <IProductHelper>().SingleInstance(); }
public void LoadDependencyGraph() { builder.RegisterModule <DataAccessModule>(); builder.RegisterModule <UtilitiesModule>(); builder.RegisterModule <ValidationModule>(); builder.RegisterModule <NumeralCalculatorModule>(); builder.Register(c => { INumeralRepository repository = c.Resolve <INumeralRepository>(); return(new Runner(c.Resolve <IProcessor>(), repository.GetInputFileContents())); }) .As <IStartable>() .SingleInstance(); }
protected override void Load(ContainerBuilder builder) { builder.RegisterType <ValidationMessageManager>().As <IValidationMessageManager>().SingleInstance(); builder.RegisterType <ArabicNumeralValidator>().As <IValidator <int> >().SingleInstance(); builder.Register(c => { INumeralRepository repository = c.Resolve <INumeralRepository>(); IEnumerable <char> romanNumeralSymbols = repository.GetRomanToArabicMap().Keys; return(new RomanNumeralValidator(romanNumeralSymbols)); }) .As <IValidator <string> >() .SingleInstance(); builder.RegisterType <RuleValidationEngine>().As <IRuleValidationEngine>().SingleInstance(); }
public RomanNumeralToDecimalConverter(INumeralRepository numeralRepository) { _numeralRepository = numeralRepository; }
public RomanNumeralValidator(INumeralRepository numeralRepository) { _numeralRepository = numeralRepository; }