Esempio n. 1
0
        public RecipeService(
            IDbSet <Recipe> set,
            IIngredientTypesService ingredientTypesService,
            IRecipeIngredientsService ingredientsService,
            IRecipeImagesService recipeImagesService,
            IRecipeStepsService recipeStepsService,
            IDbContext context)
            : base(set, context)
        {
            if (ingredientTypesService == null)
            {
                throw new ArgumentNullException();
            }

            if (ingredientsService == null)
            {
                throw new ArgumentNullException(nameof(ingredientsService));
            }

            if (recipeImagesService == null)
            {
                throw new ArgumentNullException(nameof(recipeImagesService));
            }

            if (recipeStepsService == null)
            {
                throw new ArgumentNullException(nameof(recipeStepsService));
            }

            this.ingredientTypesService = ingredientTypesService;
            this.ingredientsService     = ingredientsService;
            this.recipeImagesService    = recipeImagesService;
            this.recipeStepsService     = recipeStepsService;
        }
Esempio n. 2
0
        public void Initialize()
        {
            var dataGenerator = new TestDataGenerator();

            this.context = dataGenerator.GenerateContext();
            this.set     = this.context.RecipeSteps;
            this.service = new RecipeStepsService(this.set, this.context);
        }
Esempio n. 3
0
 public RecipeStepsController(IRecipeStepsService recipeStepsService, IMapper mapper)
 {
     _recipeStepsService = recipeStepsService;
     _mapper             = mapper;
 }