示例#1
0
        public UnitOfWork(ApplicationDbContext context,
                          IIngredientRepository ingredients,
                          IFoodRepository foods,
                          IRecipeRepository recipes,
                          IPreparationRepository preparations,
                          IPreparationStepRepository preparationSteps,
                          INutritionFactsRepository nutritionFacts,
                          INutritionFactsNutrientsRepository nutritionFactsNutrients,
                          IUserRepository users,
                          IRoleRepository roles)
        {
            _context      = context;
            _repositories = new Dictionary <string, dynamic>();

            _repositories[nameof(Ingredient)]              = Ingredients = ingredients;
            _repositories[nameof(Food)]                    = Foods = foods;
            _repositories[nameof(Recipe)]                  = Recipes = recipes;
            _repositories[nameof(Preparation)]             = Preparations = preparations;
            _repositories[nameof(PreparationStep)]         = PreparationSteps = preparationSteps;
            _repositories[nameof(NutritionFacts)]          = NutritionFacts = nutritionFacts;
            _repositories[nameof(NutritionFactsNutrients)] = NutritionFactsNutrients = nutritionFactsNutrients;
            _repositories[nameof(User)]                    = Users = users;
            _repositories[nameof(Role)]                    = Roles = roles;
        }
示例#2
0
 public PreparationTest()
 {
     _IPreparationRepository = new PreparationRepository();
 }
示例#3
0
 public PreparationService(IPreparationRepository preparationRepository)
 {
     _preparationRepository = preparationRepository;
 }