public async Task <ActionResult <Rule> > Delete(int id) { var rule = await _cache.CacheFindAsync <Rule>("Rules", a => a.Id == id); if (rule == null) { return(NotFound()); } var rules = await _cache.CacheRemoveAsync <Rule>("Rules", a => a.Id == id); await _cache.CacheSaveAsync("Rules", rules.ToArray()); return(rule); }