Exemple #1
0
        public async Task <ParticipantModel> GetByIdAsync(int participantId)
        {
            _logger.Information($"Getting participant with id = {participantId}...");

            var participant = await _repository.GetByIdAsync(participantId);

            if (participant == null)
            {
                throw new DataModelNotFoundException($"Participant with id = {participantId} was not found");
            }

            var participantModel = _mapper.Map <ParticipantModel>(participant);

            _logger.Information($"Participants with id = {participantId} was successfully loaded");

            return(participantModel);
        }
Exemple #2
0
        public async Task <UserAccountModel> GetByIdAsync(int userAccountId)
        {
            _logger.Information($"Getting user account with id = {userAccountId}...");

            var userAccount = await _repository.GetByIdAsync(userAccountId);

            if (userAccount == null)
            {
                throw new DataModelNotFoundException($"User account with id = {userAccountId} was not found");
            }

            ConvertDateTimeValuesToUtc(userAccount);
            var userAccountModel = _mapper.Map <UserAccountModel>(userAccount);

            _logger.Information($"User account with id = {userAccountId} was successfully loaded");

            return(userAccountModel);
        }