Exemple #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);
        }
Exemple #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);
        }