예제 #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));
 }
예제 #2
0
 public CategoryRepository(RecipeBookContext context) : base(context)
 {
 }
예제 #3
0
 public IngredientRepository(RecipeBookContext context) : base(context)
 {
 }
예제 #4
0
 public RecipeRepository(RecipeBookContext context) : base(context)
 {
 }
예제 #5
0
 public BaseRepository(RecipeBookContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }