public void Add(ConcertProjection item)
 {
     lock (_object)
     {
         _concerts[item.Id] = item;
     }
 }
        public void Update(ConcertProjection concert)
        {
            lock (_object)
            {
                if (!TryGetConcert(concert.Id, out ConcertProjection concertForUpdate))
                {
                    return;
                }

                _concerts[concert.Id] = concert;
            }
        }
Example #3
0
        public void Project(ConcertCreatedEvent @event)
        {
            ConcertProjection concertProjection = new ConcertProjection(@event.ConcertId, @event.Title, 0, @event.NumberOfTickets);

            _concerts.Add(concertProjection);
        }
 public bool TryGetConcert(Guid id, out ConcertProjection concertProjection)
 {
     return(_concerts.TryGetValue(id, out concertProjection));
 }