public Handler(IRecipeRepository recipeRepository, IRecipeService recipeService, ICurrentUserService currentUserService, IDateTime dateTime)
 {
     _recipeRepository   = recipeRepository;
     _recipeService      = recipeService;
     _currentUserService = currentUserService;
     _dateTime           = dateTime;
 }
 public RecipeCreateModel(IRecipeRepository recipeRepository, IItemRepository itemRepository, IUnitRepository unitRepository, IRecipeImageRepository recipeImageRepository)
 {
     this.recipeRepository      = recipeRepository;
     this.itemRepository        = itemRepository;
     this.unitRepository        = unitRepository;
     this.recipeImageRepository = recipeImageRepository;
 }
 public AddRecipeCommandHandler(
     IRecipeRepository recipeRepository, IUnitOfWork unitOfWork, IFoodProductRepository foodProductRepository)
 {
     _recipeRepository      = recipeRepository;
     _unitOfWork            = unitOfWork;
     _foodProductRepository = foodProductRepository;
 }
Exemple #4
0
 public SearchService(IIngredientsRepository ingredientsRepo, IFiltersRepository filtersRepo, IRecipeRepository recipeRepo, IMapper mapper)
 {
     _ingredientsRepo = ingredientsRepo;
     _filtersRepo     = filtersRepo;
     _recipeRepo      = recipeRepo;
     _mapper          = mapper;
 }
        public void Setup()
        {
            _mockRecipeDataContext  = new Mock <IRecipeDataContext>();
            _stubDataContextWrapper = new StubDataContextWrapper(_mockRecipeDataContext.Object);
            _recipeRepository       = new RecipeRepository(_stubDataContextWrapper);

            var recipe1 = new Recipe
            {
                recipe_id   = 1, recipe_name = "Potato", cooking_time = new TimeSpan(00, 30, 00), ingredients = "Potato",
                description = "Cook", is_favorite = false
            };
            var recipe2 = new Recipe
            {
                recipe_id   = 2, recipe_name = "Chicken", cooking_time = new TimeSpan(00, 20, 00),
                ingredients = "Chicken", description = "Boil", is_favorite = false
            };
            var recipe3 = new Recipe
            {
                recipe_id   = 3, recipe_name = "Salad", cooking_time = new TimeSpan(00, 15, 00),
                ingredients = "Cucumber - 1\nTomato - 1", description = "Cut", is_favorite = false
            };

            var recipes = new List <Recipe> {
                recipe1, recipe2, recipe3
            };

            _mockRecipeDataContext.Setup(x => x.Recipes()).Returns(new StubRecipeTable(recipes));
        }
Exemple #6
0
 public HomeController(IOptions <Settings> settings, IRecipeRepository recipeRepository, IIngredientRepository ingredientRepository, IStepsRepository stepsRepository)
 {
     _ingredientRepository = ingredientRepository;
     _stepsRepository      = stepsRepository;
     _recipeRepository     = recipeRepository;
     _settings             = settings.Value;
 }
Exemple #7
0
 /// <summary>
 /// Constructor
 /// Initialized the repositories needed for all functions needed for controller
 /// </summary>
 /// <param name="recipeRepository">creates recipe repository through dependency injection</param>
 /// <param name="foodRepository">>creates food repository through dependency injection</param>
 /// <param name="ingredientRepository">>creates ingredient repository through dependency injection</param>
 /// <param name="pantryRepository">>creates pantry repository through dependency injection</param>
 public RecipeController(IRecipeRepository recipeRepository, IFoodRepository foodRepository, IIngredientRepository ingredientRepository, IPantryRepository pantryRepository)
 {
     this.ingredientRepository = ingredientRepository;
     this.recipeRepository     = recipeRepository;
     this.foodRepository       = foodRepository;
     this.pantryRepository     = pantryRepository;
 }
Exemple #8
0
 public RecipesController(IRecipeRepository _recipeRepo, IMapper mapper, UserManager <IdentityUser> userManager, ICategoryRepository categoryRepo)
 {
     this._recipeRepo   = _recipeRepo;
     this._mapper       = mapper;
     this._userManager  = userManager;
     this._categoryRepo = categoryRepo;
 }
Exemple #9
0
 public RecipeController(
     IRecipeRepository recipeRepo,
     IRecipeIngredientRepository ingredientRepo,
     IStepRepository stepRepo,
     IRecipeImageRepository imageRepo,
     IRecipeRateRepository rateRepo,
     ICategoryRepository categoriesRepo,
     IBookmarkRepository bookMarkRepo,
     IRecipeCategoryRepository categoryRepo,
     IUserRepository userRepo,
     IHostingEnvironment environment,
     IHttpContextAccessor accessor
     )
 {
     this.recipeRepo     = recipeRepo;
     this.ingredientRepo = ingredientRepo;
     this.stepRepo       = stepRepo;
     this.imageRepo      = imageRepo;
     this.rateRepo       = rateRepo;
     this.categoriesRepo = categoriesRepo;
     this.bookMarkRepo   = bookMarkRepo;
     this.categoryRepo   = categoryRepo;
     this.userRepo       = userRepo;
     this.environment    = environment;
     this.accessor       = accessor;
 }
 public RecipesController(
     ApplicationUserManager userManager,
     IRecipeRepository recipeRepository)
 {
     _userManager      = userManager;
     _recipeRepository = recipeRepository;
 }
Exemple #11
0
 public SearchController(INewsRepository newsRepository, ITipRepository tipRepository, IAllContentRepository allContentRepository, IRecipeRepository recipeRepository)
 {
     _newsRepository = newsRepository;
     _tipRepository = tipRepository;
     _allContentRepository = allContentRepository;
     _recipeRepository = recipeRepository;
 }
Exemple #12
0
 public RecipesController(ISharedRepository sharedRepository, IRecipeRepository recipeRepository, ICategoryRepository categoryRepository,
                          IHostingEnvironment hostingEnvironment) : base(sharedRepository)
 {
     RecipeRepository   = recipeRepository;
     CategoryRepository = categoryRepository;
     HostingEnvironment = hostingEnvironment;
 }
Exemple #13
0
 public RecipeService(IRecipeRepository repo, ITagRepository tagRepository, IAppliedTagRepository appliedTagRepository, IMapper mapper)
 {
     _repo                 = repo;
     _tagRepository        = tagRepository;
     _appliedTagRepository = appliedTagRepository;
     _mapper               = mapper;
 }
 public IndexModel(IItemRepository itemRepository, IItemCategoryRepository itemCategoryRepository, IRecipeRepository recipeRepository, IUnitRepository unitRepository)
 {
     this.itemRepository         = itemRepository;
     this.itemCategoryRepository = itemCategoryRepository;
     this.recipeRepository       = recipeRepository;
     this.unitRepository         = unitRepository;
 }
Exemple #15
0
 public RecipeController(IRecipeRepository recipes, IIngredientRepository ingredients, IRecipe_IngredientRepository recipes_ingredients, IReviewRepository reviews)
 {
     recipeRepository            = recipes;
     ingredientRepository        = ingredients;
     recipe_ingredientRepository = recipes_ingredients;
     reviewRepository            = reviews;
 }
 public ManageContentsController(INewsRepository newsRepository, ITipRepository tipRepository, IQuestionRepository questionRepository, IRecipeRepository recipeRepository)
 {
     _newsRepository = newsRepository;
     _tipRepository = tipRepository;
     _recipeRepository = recipeRepository;
     _questionRepository = questionRepository;
 }
        public RecipeOverviewViewModel(IRecipeRepository recipeRepository)
        {
            RecipeRepository = recipeRepository;
            Recipes          = new ObservableCollection <Models.Recipe.Recipe>();

            InitCommand = new Command(async() => await ExecuteInit());
        }
Exemple #18
0
 public CreateRecipeCommandHandler(
     IRecipeRepository recipeRepository,
     IRecipeFactory recipeFactory)
 {
     RecipeRepository = recipeRepository;
     RecipeFactory    = recipeFactory;
 }
Exemple #19
0
 public RecipeController(IRecipeRepository recipeRepository, DataContext context, IConverter converter, ILoggerService loggerService)
 {
     _loggerService    = loggerService;
     _context          = context;
     _converter        = converter;
     _recipeRepository = recipeRepository;
 }
Exemple #20
0
 public RecipeBookController(IUnitOfWork unitOfWork)
 {
     _unitOfWork           = unitOfWork;
     _recipeRepository     = unitOfWork.RecipeRepository;
     _categoryRepository   = unitOfWork.CategoryRepository;
     _ingredientRepository = unitOfWork.IngredientRepository;
 }
        public PublicRecipeRepository(DbContext context)
        {
            _recipeRepository  = new RecipeRepository(context);
            _historyRepository = new HistoryRepository(context);

            _converter = new DtoEntityRecipeConverter();
        }
Exemple #22
0
 public RecipeListModel(IRecipeRepository recipeRepository, IRecipeImageRepository recipeImageRepository, IUserFavoriteRecipeRepository userFavoriteRecipeRepository, IUserRepository
                        userRepository) : base(userRepository)
 {
     this.recipeRepository             = recipeRepository;
     this.recipeImageRepository        = recipeImageRepository;
     this.userFavoriteRecipeRepository = userFavoriteRecipeRepository;
 }
 public ProductService(IProductRepository productRepository, IRecipeRepository recipeRepository, IEqualityComparer <ProductMap> comparer)
 {
     _productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository));
     _recipeRepository  = recipeRepository ?? throw new ArgumentNullException(nameof(recipeRepository));
     _comparer          = comparer ?? throw new ArgumentNullException(nameof(comparer));
     Initialize();
 }
Exemple #24
0
 public ApplyDiscountNotificationHandler(
     ILogger <ApplyDiscountNotificationHandler> logger,
     IRecipeRepository recipeRepository)
 {
     this.logger           = logger ?? throw new ArgumentNullException(nameof(logger));
     this.recipeRepository = recipeRepository ?? throw new ArgumentNullException(nameof(recipeRepository));
 }
Exemple #25
0
 public RecipesController(IRecipeRepository recipeRepository
                          , IMapper mapper)
 {
     _recipeRepository = recipeRepository ??
                         throw new ArgumentNullException(nameof(recipeRepository));
     _mapper = mapper ??
               throw new ArgumentNullException(nameof(mapper));
 }
Exemple #26
0
        public void Init()
        {
            _stockItemsRepository = MockRepository.GenerateMock<IStockItemsRepository>();
            _recipeRepository = MockRepository.GenerateMock<IRecipeRepository>();

            SetupFermentables();
            SetupHops();
        }
 public StatisticsController(IQuestionRepository questionRepository, ITipRepository tipRepository, INewsRepository newsRepository, IUserRepository userRepository, IRecipeRepository recipeRepository)
 {
     _questionRepository = questionRepository;
     _tipRepository = tipRepository;
     _newsRepository = newsRepository;
     _userRepository = userRepository;
     _recipeRepository = recipeRepository;
 }
Exemple #28
0
 public DeleteRecipeCommandHandler(IRecipeRepository recipeRepository,
                                   IEnumerable <ICommandValidator <DeleteRecipeCommand> > validators,
                                   IEventPublisher eventPublisher)
 {
     _recipeRepository = recipeRepository;
     _validators       = validators;
     _eventPublisher   = eventPublisher;
 }
Exemple #29
0
 public HomeController(IRecipeRepository recipeRepository, IFoodCategoryRepository foodCategoryRepository = null,
                       ICommentRepository commentRepository = null, UserManager <User> userManager = null)
 {
     _recipeRepository       = recipeRepository ?? throw new ArgumentNullException(nameof(recipeRepository));
     _foodCategoryRepository = foodCategoryRepository ?? throw new ArgumentNullException(nameof(foodCategoryRepository));
     _commentRepository      = commentRepository ?? throw new ArgumentNullException(nameof(commentRepository));
     _userManager            = userManager ?? throw new ArgumentNullException(nameof(userManager));
 }
Exemple #30
0
 public ShoplistApplicationService(IUnitOfWork uow, IShoplistRepository repository, ShoplistCommandHandler handler,
                                   IRecipeRepository recipeRepository) :
     base(uow)
 {
     this._handler          = handler;
     this._repository       = repository;
     this._recipeRepository = recipeRepository;
 }
 public AdminController(UserManager <SiteUser> userMngr,
                        RoleManager <IdentityRole> roleMngr,
                        IRecipeRepository repo)
 {
     userManager = userMngr;
     roleManager = roleMngr;
     recipeRepo  = repo;
 }
Exemple #32
0
 public UserController(UserManager <User> userManager, IRecipeRepository recipeRepository, ICommentRepository commentRepository, IFoodCategoryRepository foodCategoryRepository, IMapper mapper)
 {
     _userManager            = userManager ?? throw new ArgumentNullException(nameof(userManager));
     _recipeRepository       = recipeRepository ?? throw new ArgumentNullException(nameof(recipeRepository));
     _commentRepository      = commentRepository ?? throw new ArgumentNullException(nameof(commentRepository));
     _foodCategoryRepository = foodCategoryRepository ?? throw new ArgumentNullException(nameof(foodCategoryRepository));
     _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
 public HomeController(IIngredientRepository ingredientRepository, IRecipeRepository recipeRepository, IDietRepository dietRepository, IAuthorRepository authorRepository, ICommentRepository commentRepository)
 {
     _ingredientRepository = ingredientRepository;
     _recipeRepository = recipeRepository;
     _dietRepository = dietRepository;
     _authorRepository = authorRepository;
     _commentRepository = commentRepository;
 }
        public void GetAll_ReturnsEmptyList()
        {
            this.recipeRepository = new RecipeRepository(new FileClientMockFails());
            var actual = this.recipeRepository.GetAll();

            Assert.IsNotNull(actual);
            Assert.IsFalse(actual.Any());
        }
Exemple #35
0
 public ProductionServiceController(IWebSession webSession, ILog log, IRecipeRepository recipeRepository,
                                    IProductionService productionService, IRecipeService recipeService, IMaterialRepository materialRepository) : base(webSession, log)
 {
     m_recipeRepository   = recipeRepository;
     m_productionService  = productionService;
     m_recipeService      = recipeService;
     m_materialRepository = materialRepository;
 }
 public RecipeController(IRecipeRepository recipeRepository, 
     ICategoryRepository categoryRepository, 
     ILogger<RecipeController> logger)
 {
     _recipeRepository = recipeRepository;
     _categoryRepository = categoryRepository;
     _logger = logger;
 }
 public ScannedRecipeEditorController(
     IRecipeRepository recipeRepo, 
     IImageRepository imageRepo,
     IOcrService ocrService)
 {
     _recipeRepo = recipeRepo;
     _imageRepo = imageRepo;
     _ocrService = ocrService;
 }
 public RecipesController(IRecipeRepository recipeRepo, IRecipeIngredientRepository recipeIngredientRepo, IInstructionRepository instructionRepo, IIngredientRepository ingredientRepo, IEquipmentRepository equipmentRepo, IRecipeEquipmentRepository recipeEquipmentRepo, IUserRepository userRepo)
 {
     RecipeRepo = recipeRepo;
     RecipeIngredientRepo = recipeIngredientRepo;
     InstructionRepo = instructionRepo;
     IngredientRepo = ingredientRepo;
     EquipmentRepo = equipmentRepo;
     RecipeEquipmentRepo = recipeEquipmentRepo;
     UserRepo = userRepo;
 }
 public ManageSpamController(INewsCommentRepository newsCommentRepository, ITipCommentRepository tipCommentRepository, IRecipeCommentRepository recipeCommentRepository, IQuestionRepository questionRepository, IAnswerRepository answerRepository, INewsRepository newsRepository, ITipRepository tipRepository, IRecipeRepository recipeRepository)
 {
     _newsCommentRepository = newsCommentRepository;
     _tipCommentRepository = tipCommentRepository;
     _recipeCommentRepository = recipeCommentRepository;
     _questionRepository = questionRepository;
     _answerRepository = answerRepository;
     _newsRepository = newsRepository;
     _tipRepository = tipRepository;
     _recipeRepository = recipeRepository;
 }
Exemple #40
0
        /// <summary>
        /// Initializes a new instance of the MenuModelBase class.
        /// </summary>
        /// <param name="repository"></param>
        /// <param name="commands"></param>
        /// <param name="languageChanged"></param>
        protected MenuModelBase(IRecipeRepository repository, IEnumerable<ICommand> commands, ILanguageChanged languageChanged)
        {
            _repository = repository;
            _repository.RecipesChangedEvent += HandleChangedEvent;

            _commands = commands.ToList();

            languageChanged.LanguageChangedEvent += HandleChangedEvent;

            BuildMenu();
        }
        public EditRecipeViewModel(IEventAggregator eventAggregator, IStockItemsViewModel stockItemsViewModel, IRecipeRepository recipeRepository)
        {
            this._recipeRepository = recipeRepository;
            StockItemsViewModel = stockItemsViewModel;

            VolumeUnits = new List<VolumeUnit> { VolumeUnit.Litres, VolumeUnit.Gallons };
            _recipe = new Recipe();
            _recipe.SetBrewLength(20.Litres());

            eventAggregator.GetEvent<AddHopToRecipeEvent>().Subscribe(AddHop);
            eventAggregator.GetEvent<AddFermentableToRecipeEvent>().Subscribe(AddFermentable);
        }
 public MealController(IMealRepository mealRepository, IIngredientRepository ingredientRepository, IQuantityTypeRepository quantityTypeRepository, IIngredientCategoryRepository ingredientCategoryRepository, IMealIngredientRepository mealIngredientRepository, IMealCategoryRepository categoryRepository, IRecipeRepository recipeRepository, IUserRepository userRepository, IAuthorRepository authorRepository, IIngredientQuantityRepository ingredientQuantityRepository)
 {
     _mealRepository = mealRepository;
     _ingredientRepository = ingredientRepository;
     _quantityTypeRepository = quantityTypeRepository;
     _ingredientCategoryRepository = ingredientCategoryRepository;
     _mealIngredientRepository = mealIngredientRepository;
     _categoryRepository = categoryRepository;
     _recipeRepository = recipeRepository;
     _userRepository = userRepository;
     _authorRepository = authorRepository;
     _ingredientQuantityRepository = ingredientQuantityRepository;
 }
 public RecipeController(IRecipeRepository recipeRepository,
     IStyleRepository styleRepository,
     IUserProfileEntityFactory userProfileEntityFactory,
     IRecipeDisplayViewModelMapper displayViewModelMapper,
     IRecipeEditViewModelMapper editViewModelMapper)
     : base()
 {
     this._recipeRepository = recipeRepository;
     this._styleRepository = styleRepository;
     this._userProfileEntityFactory = userProfileEntityFactory;
     this._displayViewModelMapper = displayViewModelMapper;
     this._editViewModelMapper = editViewModelMapper;
 }
 public MealControllerTest()
 {
     MapperConfig.ConfigureMapper();
     _mealRepository = new FakeMealRepository();
     _ingredientRepository = new FakeIngredientRepository();
     _quantityTypeRepository = new FakeQuantityTypeRepository();
     _ingredientCategoryRepository = new FakeIngredientCategoryRepository();
     _mealIngredientRepository = new FakeMealIngredientRepository();
     _mealCategoryRepository = new FakeMealCategoryRepository();
     _recipeRespository = new FakeRecipeRepository();
     _userRepository =  new FakeUserRepository();
     _authorRepository = new FakeAuthorRepository();
     _ingredientQuantityRepository = new FakeIngredientQuantityRepository();
     _controller = new MealController(_mealRepository, _ingredientRepository, _quantityTypeRepository, _ingredientCategoryRepository, _mealIngredientRepository, _mealCategoryRepository, _recipeRespository, _userRepository, _authorRepository, _ingredientQuantityRepository);
 }
 public ManageApprovalController(IRecipeRepository repository)
 {
     _repository = repository;
 }
 public HomeController(IRecipeRepository recipeRepo, IUserRepository userRepo)
 {
     _recipeRepo = recipeRepo;
     _userRepo = userRepo;
 }
Exemple #47
0
 public HomeController(ITipRepository tipRepository, INewsRepository newsRepository, IRecipeRepository recipeRepository)
 {
     _tipRepository = tipRepository;
     _newsRepository = newsRepository;
     _recipeRepository = recipeRepository;
 }
Exemple #48
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="repository"></param>
 /// <param name="commands"></param>
 public MainMenuModel(IRecipeRepository repository, IEnumerable<ICommand> commands, IToolsPresenter presenter)
     : base(repository, commands, presenter)
 {
 }
 public void Setup()
 {
     repository = new RecipeRepository();
     manager = new UriLocationManager(repository);
 }
Exemple #50
0
 public HomeController(ILogger<HomeController> logger, IRecipeRepository repository)
 {
     _repository = repository;
     _logger = logger;
 }
Exemple #51
0
 public HomeController(IRecipeRepository recipeRepository, ICategoryRepository categoryRepository)
 {
     _recipeRepository = recipeRepository;
     _categoryRepository = categoryRepository;
 }
 public void Setup()
 {
     repository = new RecipeRepository();
     manager = new UnitOfMeasureManager(repository);
 }
 public RecipeController(IRecipeRepository recipeRepository, ILanguageProvider languageProvider, RestContext context)
 {
     _languageProvider = languageProvider;
     _recipeRepository = recipeRepository;
     _context = context;
 }
Exemple #54
0
 /// <summary>
 /// 
 /// </summary>
 public RecipePresenter(IRecipeRepository repository, IRecipeView view)
 {
     _repository = repository;
     _view = view;
 }
 public void Setup()
 {
     repository = new RecipeRepository();
     manager = new IngredientManager(repository);
 }
Exemple #56
0
 public RecipeController(IRecipeRepository recipeRepository, ICategoryRepository categoryRepository,IImageRepository imageRepository)
 {
     _recipeRepository = recipeRepository;
     _categoryRepository = categoryRepository;
     _imageRepository = imageRepository;
 }
 public void Setup()
 {
     repository = new RecipeRepository();
     manager = new WineManager(repository);
 }
 public void Setup()
 {
     repository = new RecipeRepository();
 }
 public RecipeController(IRecipeRepository recipeRepository)
 {
     this.recipeRepository = recipeRepository;
 }
 public void Setup()
 {
     repository = new RecipeRepository();
     manager = new NutritionalInformationManager(repository);
 }