Ejemplo n.º 1
0
        public async Task UpdateSample(SampleDto dto)
        {
            var sample = await repo.GetSample(dto.Id);

            await repo.UpdateSample(dto.ToSample());

            var createdEvent = new SampleUpdatedEvent(dto.Id, sample.ToSampleDto(), dto);

            eventContext.AddEvents(createdEvent);
        }
Ejemplo n.º 2
0
        public async Task <Guid> InsertSample(SampleDto dto)
        {
            var sample = dto.ToSample();

            await repo.InsertSample(sample);

            var createdEvent = new SampleCreatedEvent(sample.ToSampleDto());

            eventContext.AddEvents(createdEvent);

            return(sample.Id);
        }