Exemple #1
0
        /// <summary>
        /// Gets the value.
        /// </summary>
        /// <param name="searchValueDto">The request to search value.</param>
        /// <returns></returns>
        public async Task <PagedResultDto <ResponseValueDto> > GetAsync(RequestSearchTermValueDto searchValueDto)
        {
            var searchValueMapp = _mapper.Map <RequestSearchTermValueDto, SearchTermValue>(searchValueDto);

            var valuesEntity = await _valueRepository.GetAsync(searchValueMapp);

            var valuesMapp = _mapper.Map <PagedResult <Entities.Value>, PagedResultDto <ResponseValueDto> >(valuesEntity);

            return(valuesMapp);
        }
Exemple #2
0
 public async Task <ActionResult <string> > Get(string key)
 {
     try
     {
         return(Ok(await _valueRepository.GetAsync(key)));
     }
     catch (KeyNotFoundException)
     {
         return(NotFound());
     }
 }