Exemple #1
0
 public WineController(
     IWineQuery wineQuery,
     IWineService wineService
     )
 {
     _wineQuery   = wineQuery;
     _wineService = wineService;
 }
Exemple #2
0
 public WineController(ICategoryService categoryService,
                       IWineService wineService) : base(categoryService)
 {
     // Task 2, hard code.
     // _wineService = new WineBusiness(new WineDataAccess(
     // "server=73.202.59.32;port=33306;database=wine_taste;user=root;password=toor"));
     // Task3, use service.
     _wineService = wineService;
 }
Exemple #3
0
 public RootViewModel(IWineService wineService)
 {
     if (wineService == null)
     {
         throw new ArgumentNullException(nameof(wineService));
     }
     _wineService = wineService;
     Wines        = new ObservableCollection <WineItemViewItem>();
     AddWine      = new RelayCommand(AddWineSelected);
 }
        public void SetUp()
        {
            _configurationBuilder = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();

            _serviceProvider = new ServiceCollection()
                               .AddScoped <IWineService, WineService>()
                               .AddSingleton <IWineRepository>(new WineRepository(_configurationBuilder))
                               .BuildServiceProvider();

            _wineService = _serviceProvider.GetService <IWineService>();
        }
 public WinesController(IWineService wineService)
 {
     _wineService = wineService;
 }
 public WineController(IWineService wineService)
 {
     _wineService = wineService;
 }
Exemple #7
0
 public WinesController(IWineService service)
 {
     _wineService = service;
 }