示例#1
0
        public async Task <UpdateExampleOutput> ExecuteAsync(UpdateExampleInput input)
        {
            var existingExample = await exampleRepository.FindAsync(input.Id);

            if (existingExample == null)
            {
                throw new NullReferenceException($"Example met id '{input.Id}' niet gevonden.");
            }

            existingExample.Update(input);

            await exampleRepository.UpdateAsync(existingExample);

            await exampleRepository.UnitOfWork.SaveChangesAsync();

            return(new UpdateExampleOutput());
        }