Пример #1
0
        public async Task <AllergyModel> Handle(CreateAllergyCommand request, CancellationToken cancellationToken)
        {
            long insertedId = await _repository.CreateAllergyAsync(new Allergy()
            {
                Id        = request.Id,
                Name      = request.Name,
                CreatedBy = "APPLICATION",
            });

            var allergy = await _repository.GetAllergyByIdAsync(insertedId);

            return(new AllergyModel()
            {
                Id = allergy.Id,
                Name = allergy.Name
            });
        }