예제 #1
0
        public async Task <GetPolicyViewModel> AddPolicyAsync(PolicyViewModel policyViewModel)
        {
            var policy = _mapper.Map <Policy>(policyViewModel);

            var addedPolicy = await _policyRepository.AddAsync(policy);

            _logger.LogInformation($"Policy has been created - id: {policy.Id}");

            return(_mapper.Map <GetPolicyViewModel>(addedPolicy));
        }