Beispiel #1
0
        public async Task <IActionResult> GetById([FromRoute] Guid id)
        {
            if (_cache.TryGetValue(id, out Entity result))
            {
                return(Ok(result));
            }

            result = await _simpleRepository.GetById(id);

            if (result == null)
            {
                return(NotFound());
            }
            _cache.Set(id, result);

            return(Ok(result));
        }