Esempio n. 1
0
 public UnitOfWork(RecipeBookContext context, ICategoryRepository categoryRepository,
                   IIngredientRepository ingredientRepository, IRecipeRepository recipeRepository, IRecipeIngredientRepository recipeIngredientRepository,
                   IRecipeStepRepository recipeStepRepository)
 {
     _context          = context ?? throw new ArgumentNullException(nameof(context));
     Categories        = categoryRepository ?? throw new ArgumentNullException(nameof(categoryRepository));
     Recipes           = recipeRepository ?? throw new ArgumentNullException(nameof(recipeRepository));
     Ingredients       = ingredientRepository ?? throw new ArgumentNullException(nameof(ingredientRepository));
     RecipeIngredients = recipeIngredientRepository ?? throw new ArgumentNullException(nameof(recipeIngredientRepository));
     RecipeSteps       = recipeStepRepository ?? throw new ArgumentNullException(nameof(recipeStepRepository));
 }
Esempio n. 2
0
 public CategoryRepository(RecipeBookContext context) : base(context)
 {
 }
Esempio n. 3
0
 public IngredientRepository(RecipeBookContext context) : base(context)
 {
 }
Esempio n. 4
0
 public RecipeRepository(RecipeBookContext context) : base(context)
 {
 }
Esempio n. 5
0
 public BaseRepository(RecipeBookContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }