public Domain.Deelnemer.Deelnemer Get(Guid id) { var repo = new EventSourcedAggregateRepository<PensioenSysteem.Domain.Deelnemer.Deelnemer>( new FileEventStore(new RabbitMQEventPublisher())); var deelnemer = repo.GetById(id); return deelnemer; }
public Domain.Deelnemer.Deelnemer Get(Guid id) { var repo = new EventSourcedAggregateRepository <PensioenSysteem.Domain.Deelnemer.Deelnemer>( new FileEventStore(new RabbitMQEventPublisher())); var deelnemer = repo.GetById(id); return(deelnemer); }
public Domain.Arbeidsverhouding.Arbeidsverhouding Get(Guid id) { var repo = new EventSourcedAggregateRepository <PensioenSysteem.Domain.Arbeidsverhouding.Arbeidsverhouding>( new FileEventStore(new RabbitMQEventPublisher())); var arbeidsverhouding = repo.GetById(id); return(arbeidsverhouding); }
public TAggregate GetById(Guid aggregateId) { TAggregate aggregate; if (cache.TryGetValue(aggregateId, out aggregate)) { return(aggregate); } AggregateRepository <TAggregate> repository = new EventSourcedAggregateRepository <TAggregate>(aggregateEventStore); aggregate = repository.GetById(aggregateId); cache.TryAdd(aggregateId, aggregate); return(aggregate); }
public HttpResponseMessage Verhuis(Guid id, [FromBody] VerhuisDeelnemerCommand command) { var repo = new EventSourcedAggregateRepository<PensioenSysteem.Domain.Deelnemer.Deelnemer>( new FileEventStore(new RabbitMQEventPublisher())); Domain.Deelnemer.Deelnemer deelnemer; try { deelnemer = repo.GetById(id); } catch (AggregateNotFoundException ex) { return new HttpResponseMessage(HttpStatusCode.NotFound); } deelnemer.Verhuis(command); repo.Save(deelnemer, command.Version); return new HttpResponseMessage(HttpStatusCode.OK); }
public HttpResponseMessage Verhuis(Guid id, [FromBody] VerhuisDeelnemerCommand command) { var repo = new EventSourcedAggregateRepository <PensioenSysteem.Domain.Deelnemer.Deelnemer>( new FileEventStore(new RabbitMQEventPublisher())); Domain.Deelnemer.Deelnemer deelnemer; try { deelnemer = repo.GetById(id); } catch (AggregateNotFoundException ex) { return(new HttpResponseMessage(HttpStatusCode.NotFound)); } deelnemer.Verhuis(command); repo.Save(deelnemer, command.Version); return(new HttpResponseMessage(HttpStatusCode.OK)); }