Example #1
0
        public async Task Delete(ApplicantModel applicantModel)
        {
            ValidateApplicantIfNotExist(applicantModel);
            var deletedApplicant = await _applicantRepository.GetByIdAsync(applicantModel.ID);

            if (deletedApplicant == null)
            {
                throw new Exception($"Entity could not be loaded.");
            }

            await _applicantRepository.DeleteAsync(deletedApplicant);

            _logger.LogInformation($"Entity successfully deleted - ApplicantService");
        }