public ItemManager( ItemRepository repository, ITradingPostApiWrapper apiWrapper) { _repository = repository; _apiWrapper = apiWrapper; }
private void Init() { // prevent design time error in xaml designer if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(new DependencyObject())) { _contextProvider = new FakeDataContextProvider(); } else { _contextProvider = new GameDataContextProvider(); } _tpApiWrapper = new TradingPostApiWrapper(new ApiAccessor(new WebClientProvider())); _dataUpdater = new ApiDataUpdater(_tpApiWrapper); _dbBuilder = new DbBuilder(_tpApiWrapper, _contextProvider); _dbBuilder.BuildDatabase(); using (var context = _contextProvider.GetContext()) { _sharedItems = context.GameItems.ToList(); } _sharedItemDictionary = _sharedItems.ToDictionary(item => item.ItemId, item => item); Task.Run(() => _dataUpdater.UpdatePricesParallel(_sharedItems)); }
public DbBuilder(ITradingPostApiWrapper wrapper, IGameDataContextProvider contextProvider) { _wrapper = wrapper; _contextProvider = contextProvider; }
public ApiDataUpdater(ITradingPostApiWrapper wrapper) { _tpApiWrapper = wrapper; }
public CommerceService(ITradingPostApiWrapper tpWrapper, INotifyService notifyService) { _tpWrapper = tpWrapper; _notifyService = notifyService; }