/// <summary> /// Removes the supplied share from the watchlist. /// </summary> /// <param name="userId">The unique identifier of the user who owns the watchlist.</param> /// <param name="watchlistId">The unique identifier of the watchlist.</param> /// <param name="symbol">The share symbol.</param> private Watchlist GetWatchlist(Guid userId, Guid watchlistId) { Watchlist watchlist = _watchlistRepository.GetById(watchlistId); if (watchlist == null || watchlist.UserId != userId) { throw new EntityNotFoundException(nameof(Watchlist), watchlistId); } return(watchlist); }