Esempio n. 1
0
        public async Task <DataResult <SpecieViewModel> > GetSpecieViewById(int id)
        {
            try
            {
                SpecieViewModel model = await _specieRepository.GetModelById(id);

                return(new DataResult <SpecieViewModel>
                {
                    Success = true,
                    Data = model,
                });
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, $"Problems with getting Specie by id : {id}");
                return(new DataResult <SpecieViewModel>
                {
                    Success = false,
                    ErrorCode = ErrorCode.InternalError,
                });
            }
        }