public void DeleteInvestment(InvestmentModel investment)
 {
     using (var context = _contextProvider.GetContext())
     {
         InvestmentWatchlistModel contextWatchlist =
             context.InvestmentWatchlists.Single(wl => wl.Id == SelectedWatchlist.Id);
         InvestmentModel investmentToDelete = context.Investments.Single(inv => inv.Id == investment.Id);
         contextWatchlist.Items.Remove(investmentToDelete);
         context.Investments.Remove(investmentToDelete);
         context.Save();
     }
     SelectedWatchlist.Items.Remove(investment);
 }
 public void FinalizeResult()
 {
     Investment = new InvestmentModel
     {
         Count = Quantity,
         GameItem = SelectedItem,
         IsSold = IsSold,
         DesiredSellPrice = TargetSellPrice.Value,
         PurchasePrice = BuyPrice.Value,
         SoldFor = SellPrice.Value
     };
 }
 public void AddInvestment(InvestmentModel investment)
 {
     using (var context = _contextProvider.GetContext())
     {
         var contextWatchlists = context.InvestmentWatchlists.Single(wl => wl.Id == SelectedWatchlist.Id);
         context.GameItems.Attach(investment.GameItem);
         contextWatchlists.Items.Add(investment);
         context.Save();
     }
     SelectedWatchlist.Items.Add(investment);
 }