コード例 #1
0
 public FoodsController(IFoodRepository foodRepository, IMapper mapper, IUnitOfWork <ICommunityDbContext> unitOfWork, IDomainNotificationHandler domainNotificationHandler, IMediator mediator, ILogger <FoodsController> logger)
     : base(domainNotificationHandler, mediator, logger)
 {
     _foodRepository = foodRepository;
     _mapper         = mapper;
     _unitOfWork     = unitOfWork;
 }
コード例 #2
0
 public FoodController(IFoodRepository foodRepository, IUserRepository userRepository,
                       IWaterRepository waterRepository)
 {
     this.foodRepository  = foodRepository;
     this.userRepository  = userRepository;
     this.waterRepository = waterRepository;
 }
コード例 #3
0
ファイル: LogDayViewModel.cs プロジェクト: Martinh-pb/FoodLog
        public LogDayViewModel(IFoodRepository foodRepository)
        {
            FoodRepository = foodRepository;

            Title = "";
            Items = new ObservableCollection <FoodDayGroup>();

            Date = DateTime.MinValue;

            BreakFast = new FoodDayGroup("Ontbijt", MealType.BreakFast);
            Items.Add(BreakFast);

            Lunch = new FoodDayGroup("Lunch", MealType.Lunch);
            Items.Add(Lunch);

            Diner = new FoodDayGroup("Diner", MealType.Diner);
            Items.Add(Diner);

            Snack = new FoodDayGroup("Snack", MealType.Snack);
            Items.Add(Snack);

            InitDayCommand   = new Command(async() => await ExecuteDayCommand());
            LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand());

            MessagingCenter.Subscribe <LogAddToDayPage, FoodPerDay>(this, "AddItem", async(obj, item) =>
            {
                var newItem = item as FoodPerDay;

                await FoodRepository.SaveFoodForDay(newItem);
            });
        }
コード例 #4
0
 public OrderController(IOrderRepository orderRepository, IMenuItemRepository menuItemRepository, IFoodRepository foodRepository, IConfiguration configuration)
 {
     this._orderRepository    = orderRepository;
     this._menuItemRepository = menuItemRepository;
     this._foodRepository     = foodRepository;
     this._configuration      = configuration;
 }
コード例 #5
0
 public FoodController(IFoodFactory foodFactory, IMealFactory mealFactory, IFoodRepository repository, IMealRepository mealRepository)
 {
     this.repository = repository;
     this.mealRepository = mealRepository;
     this.foodFactory = foodFactory;
     this.mealFactory = mealFactory;
 }
コード例 #6
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;
 }
 public FoodsController(IFoodRepository foodRepository, IFoodListRepository foodListRepository,
                        IRandomNumberGenerator randomNumberGenerator)
 {
     _foodRepository        = foodRepository;
     _foodListRepository    = foodListRepository;
     _randomNumberGenerator = randomNumberGenerator;
 }
コード例 #8
0
ファイル: LogAddViewModel.cs プロジェクト: Martinh-pb/FoodLog
        public LogAddViewModel(IFoodRepository foodRepository, FoodPerDay entry)
        {
            FoodRepository = foodRepository;
            Item           = entry;

            SelectableFoods = new ObservableCollection <Food>();

            MealTypes = new ObservableCollection <MealTypeItem>();
            MealTypes.Add(new MealTypeItem()
            {
                MealType = MealType.BreakFast, Name = "Ontbijt"
            });
            MealTypes.Add(new MealTypeItem()
            {
                MealType = MealType.Lunch, Name = "Lunch"
            });
            MealTypes.Add(new MealTypeItem()
            {
                MealType = MealType.Diner, Name = "Diner"
            });
            MealTypes.Add(new MealTypeItem()
            {
                MealType = MealType.Snack, Name = "Tussendoor"
            });

            SelectedMealType = MealTypes.First(f => f.MealType == entry.MealType);
        }
コード例 #9
0
 public ActiveStudent(ISettings settings, IStudentRepository studentRepository, IFoodRepository foodRepository, Lazy <IReserveLogRepository> reserveLogRepository)
 {
     _reserveLogRepository = reserveLogRepository;
     _foodRepository       = foodRepository;
     _settings             = settings;
     _studentRepository    = studentRepository;
 }
コード例 #10
0
 public CheckoutController(IOrderRepository orderRepository, IUserOrderRepository userOrderRepository, IOrderDetailRepository orderDetailRepository, IFoodRepository foodRepository)
 {
     _orderRepository       = orderRepository;
     _userOrderRepository   = userOrderRepository;
     _orderDetailRepository = orderDetailRepository;
     _foodRepository        = foodRepository;
 }
コード例 #11
0
 public UnitOfWork(FoodContext context, IFoodRepository foodRepository, IFoodCategoryRepository foodCategoryRepository,IPresetMealRepository presetMealRepository)
 {
     Context = context;
     FoodRepository = foodRepository;
     FoodCategoryRepository = foodCategoryRepository;
     PresetMealRepository = presetMealRepository;
 }
コード例 #12
0
 public FoodService()
 {
     if (Repository == null)
     {
         Repository = new FoodRepository();
     }
 }
コード例 #13
0
ファイル: MealController.cs プロジェクト: Seglya/BeFit
 public MealController(IFoodRepository foodRepository, IIngestionRepository ingestionRepository, IOneDayFoodRepository oneDayFoodRepository, IWeightOfFoodRepository weightOfFoodRepository)
 {
     _foodRepository         = foodRepository;
     _ingestionRepository    = ingestionRepository;
     _oneDayFoodRepository   = oneDayFoodRepository;
     _weightOfFoodRepository = weightOfFoodRepository;
 }
コード例 #14
0
        public MainWindow()
        {
            InitializeComponent();

            builder = new ContainerBuilder();
            builder.RegisterModule(new DataModule("ExamDiaryDB_AndrianovaConnectionString"));

            builder.RegisterType <EFContext>().As <IEFContext>();
            builder.RegisterType <FoodRepository>().As <IFoodRepository>();
            builder.RegisterType <MyPlateRepository>().As <IMyPlateRepository>();
            builder.RegisterType <PlateFoodRecordRepository>().As <IPlateFoodRecordRepository>();
            Container = builder.Build();

            foodRep    = Container.Resolve <IFoodRepository>();
            myplateRep = Container.Resolve <IMyPlateRepository>();
            platefoodrecordRepositoryRep = Container.Resolve <IPlateFoodRecordRepository>();

            if (checkNet() == true)
            {
                ProductComboBox.ItemsSource = GetData();
                List <Food> list = GetData();
                foreach (var p in list)
                {
                    foodlist.Add(p);
                }
                MealTimePicker.SelectedDate = DateTime.Now;
            }
            else
            {
                MessageBox.Show("Невозможно открыть программу! Отсутствует подключение к сети Интернет!");
                System.Windows.Application.Current.Shutdown();
            }
        }
コード例 #15
0
 public IngredientsController(IProductRepository repository, IFoodRepository foodRepository,
                              IHubContext <FoodHub> hubContext)
 {
     _repository     = repository;
     _foodRepository = foodRepository;
     _hubContext     = hubContext;
 }
コード例 #16
0
        public CartService(IFoodRepository foodRepository, IUserRepository userRepository, DtoModelMapper dtoModelMapper)
        {
            _userRepository = userRepository;
            _foodRepository = foodRepository;

            _dtoModelMapper = dtoModelMapper;
        }
コード例 #17
0
 public FoodController(IFoodRepository food, ILogger <FoodController> logger, IMapper mapper, IUrlHelper urlHelper)
 {
     _food      = food;
     _mapper    = mapper;
     _logger    = logger;
     _urlHelper = urlHelper;
 }
コード例 #18
0
        public CartService()
        {
            _userRepository = new UserRepository(DataStore.Instance.State.Users);
            _foodRepository = new FoodRepository(DataStore.Instance.State.Foods);

            _dtoModelMapper = new DtoModelMapper();
        }
コード例 #19
0
        public DetalesAndRecommendationsWindow(SqlDateTime t)
        {
            InitializeComponent();
            _t = t;

            builder = new ContainerBuilder();
            builder.RegisterModule(new DataModule("ExamDiaryDB_AndrianovaConnectionString"));

            builder.RegisterType <EFContext>().As <IEFContext>();
            builder.RegisterType <FoodRepository>().As <IFoodRepository>();
            builder.RegisterType <MyPlateRepository>().As <IMyPlateRepository>();
            builder.RegisterType <PlateFoodRecordRepository>().As <IPlateFoodRecordRepository>();
            Container = builder.Build();

            foodRep    = Container.Resolve <IFoodRepository>();
            myplateRep = Container.Resolve <IMyPlateRepository>();
            platefoodrecordRepositoryRep = Container.Resolve <IPlateFoodRecordRepository>();


            YourHeightTextBox.Text = user._Height.ToString();
            YourWeightTextBox.Text = user._Weight.ToString();
            YourAgeTextBox.Text    = user._Age.ToString();
            YourCcal.Text          = user._Ccal.ToString();
            if (user._Gender == true)
            {
                radioButtonFemale.IsChecked = true;
            }
            else
            {
                radioButtonMale.IsChecked = true;
            }
        }
コード例 #20
0
        /// <summary>
        /// Counstructor
        /// </summary>
        /// <param name="fastFoodDbContext">FastFoodDbContext - Injection</param>
        /// <param name="foodRepository">FoodRepository - Injection</param>
        /// <param name="paymentRepository">PaymentRepository - Injection</param>
        /// <param name="userRepository">UserRepository - Injection</param>
        /// <param name="paymentMethodRepository">PaymentMethodRepository - Injection</param>
        /// <param name="sentEmailRepository">SentEmailRepository - Injection</param>
        /// <param name="sentMessageRepository">SentMessageRepository - Injection</param>
        /// <param name="authorizationRepository">AuthorizationRepository - Injection</param>
        public UnitOfWork
        (
            FastFoodDbContext fastFoodDbContext,
            IFoodRepository foodRepository,
            IPaymentRepository paymentRepository,
            IUserRepository userRepository,
            IPaymentMethodRepository paymentMethodRepository,
            ISentEmailRepository sentEmailRepository,
            ISentMessageRepository sentMessageRepository,
            IAuthorizationRepository authorizationRepository
        )
        {
            _fastFoodDbContext = fastFoodDbContext;

            FoodRepository          = foodRepository;
            PaymentRepository       = paymentRepository;
            UserRepository          = userRepository;
            PaymentMethodRepository = paymentMethodRepository;
            SentEmailRepository     = sentEmailRepository;
            SentMessageRepository   = sentMessageRepository;
            AuthorizationRepository = authorizationRepository;

            // Setup the DbContext
            FoodRepository.DbContext          = _fastFoodDbContext;
            PaymentRepository.DbContext       = _fastFoodDbContext;
            UserRepository.DbContext          = _fastFoodDbContext;
            PaymentMethodRepository.DbContext = _fastFoodDbContext;
            SentEmailRepository.DbContext     = _fastFoodDbContext;
            SentMessageRepository.DbContext   = _fastFoodDbContext;
            AuthorizationRepository.DbContext = _fastFoodDbContext;
        }
コード例 #21
0
 public MealService(IFoodRepository foodRepository, IMealRepository mealRepository,
                    IUserRepository userRepository, IUnitOfWork unitOfWork)
 {
     this.unitOfWork     = unitOfWork;
     this.foodRepository = foodRepository;
     this.mealRepository = mealRepository;
     this.userRepository = userRepository;
 }
コード例 #22
0
        public StatsViewModel(IOrderService orderService, IFoodRepository foodRepository)
        {
            var orders = orderService.GetPastOrders().Result;

            _orderedFood = orders.Select(order => foodRepository.GetFoodInfo(order.FoodId)).ToList();
            CalculateSpendStats();
            CalculateHealthStats();
        }
コード例 #23
0
 public RestaurantsController(IFoodTypeRepository foodType, IFoodCategoryRepository foodCategory, IRestaurantRepository restaurant, IRestaurantFoodRepository restaurantFood, IFoodRepository food)
 {
     _foodType       = foodType;
     _foodCategory   = foodCategory;
     _restaurant     = restaurant;
     _restaurantFood = restaurantFood;
     _food           = food;
 }
コード例 #24
0
 public FoodsController(IUrlHelper urlHelper, IFoodRepository foodRepository,
                        IHubContext <FoodHub> hubContext, IHttpContextAccessor accessor)
 {
     _foodRepository = foodRepository;
     _hubContext     = hubContext;
     _urlHelper      = urlHelper;
     _accessor       = accessor;
 }
コード例 #25
0
 public MealCommandHandler(IMealRepository mealRepository, IFoodRepository foodRepository, IMapper mapper, IIdentityService identityService, IMediator mediator, IUnitOfWork <ICommunityDbContext> unitOfWork, ILogger <MealCommandHandler> logger)
     : base(identityService, mediator, unitOfWork, logger)
 {
     _mealRepository   = mealRepository;
     _foodRepository   = foodRepository;
     _mapper           = mapper;
     _currentProfileId = GetCurrentProfileId();
 }
コード例 #26
0
 public FoodService(IFoodRepository foodRepository,
                    ILogger <FoodService> logger,
                    IMapper mapper)
 {
     _foodRepository = foodRepository;
     _logger         = logger;
     _mapper         = mapper;
 }
コード例 #27
0
 public FoodsController(
     IUrlHelper urlHelper,
     IFoodRepository foodRepository,
     IMapper mapper)
 {
     _foodRepository = foodRepository;
     _mapper         = mapper;
     _urlHelper      = urlHelper;
 }
コード例 #28
0
 public FoodService(IFoodRepository foodRepository,
                    IMessageHandler feedbackHandler, IMessageSerializer messageSerializer,
                    IQueryHelper queryHelper)
 {
     _foodRepository      = foodRepository;
     this.FeedbackHandler = feedbackHandler;
     _messageSerializer   = messageSerializer;
     _queryHelper         = queryHelper;
 }
コード例 #29
0
 public SesshinService(ISesshinRepository sesshinRepository,
                       IFoodRepository foodRepository,
                       IDayOfSesshinRepository dayOfSesshinRepository,
                       IUnitOfWork unitOfWork)
     : base(sesshinRepository, unitOfWork)
 {
     _foodRepository         = foodRepository;
     _dayOfSesshinRepository = dayOfSesshinRepository;
 }
 public FoodItemsController(
     IFoodRepository foodRepository,
     IHubContext <ChatHub> hubContext,
     IMapper mapper)
 {
     _foodRepository = foodRepository;
     _chatHubContext = hubContext;
     _mapper         = mapper;
 }
コード例 #31
0
 public DietService(
     IFoodRepository foodRepository,
     IPlanRepository planRepository,
     IProfileRepository profileRepository)
 {
     this.foodRepository    = foodRepository;
     this.planRepository    = planRepository;
     this.profileRepository = profileRepository;
 }
コード例 #32
0
 public FoodManager(IFoodRepository foodRepository,
                    IRestaurantRepository restaurantRepository,
                    IUserRepository userRepository,
                    IHttpContextAccessor httpContext)
 {
     this.foodRepository       = foodRepository;
     this.restaurantRepository = restaurantRepository;
     this.userRepository       = userRepository;
     this.httpContext          = httpContext;
 }
コード例 #33
0
ファイル: FoodFactory.cs プロジェクト: dimtruck/The-Challenge
        public Food RetrieveCompleteFood(int id, IFoodRepository repository)
        {
            //retrieve from cache
            Food food = FoodClient.RetrieveCompleteFood(id);
            if (food == null)
            {
                //retrieve from database
                food = repository.RetrieveCompleteFood(id);
                //save to cache
                FoodClient.SaveCompleteFood(food, id);
            }

            return food;
        }
コード例 #34
0
ファイル: FoodFactory.cs プロジェクト: dimtruck/The-Challenge
        public IList<Food> RetrieveFoods(IFoodRepository repository)
        {
            //retrieve from cache
            IList<Food> foods = FoodClient.RetrieveFoods();
            if (foods == null)
            {
                //retrieve from database
                foods = repository.RetrieveFoods();
                //save to cache
                FoodClient.SaveFoods(foods);
            }

            return foods;
        }
コード例 #35
0
 public CartController(IFoodRepository repository)
 {
     _repository = repository;
 }
コード例 #36
0
 public NavigationController(IFoodRepository repository)
 {
     this._repository = repository;
 }
 public FoodItemsController(IFoodRepository foodRepository, IConnectionManager connectionManager, ITimerService timerService)
 {
     _foodRepository = foodRepository;
     _coolMessageHubContext = connectionManager.GetHubContext<CoolMessagesHub>();
     timerService.TimerElapsed += _timerService_TimerElapsed;
 }
コード例 #38
0
 public FoodLogic(IUnitOfWork unit, IFoodRepository repo, ITeamLogic teamLogic)
 {
     this.Unit = unit;
     this.Repo = repo;
     this.TeamLogic = teamLogic;
 }