コード例 #1
0
        public JobService(IOpenFoodProvider openFoodProvider, IOpenFoodRepository openFoodRepository, IOptions <OpenFoodSettings> settings)
        {
            if (settings.Value.ImportedProductsMaxValue <= 0)
            {
                throw new NotFoundException("Numero máximo de arquivos importados não definido");
            }

            if (string.IsNullOrEmpty(settings.Value.OpenFoodImageUrlBase))
            {
                throw new NotFoundException("Url base para geração das imagens não foi definida");
            }

            ImportedProductsMaxValue = settings.Value.ImportedProductsMaxValue;
            _openFoodProvider        = openFoodProvider;
            _openFoodRepository      = openFoodRepository;
            _settings = settings;
        }
コード例 #2
0
 public OpenFoodService(IOpenFoodRepository openFoodRepository)
 {
     _openFoodRepository = openFoodRepository;
 }