public async Task <IActionResult> Get(int id) { var product = await _cashService.TryExecuteAsync <Product>(() => _productRepository.GetProduct(id), id); if (product != null) { return(Content($"Product: {product.Name}")); } return(Content("Product not found")); }
public async Task <IActionResult> Get(int id) { var post = await _cashService.TryExecuteAsync <Post>(() => _postRepository.GetPost(id), id); if (post != null) { return(Content($"Description: {post.Description}")); } return(Content("Post not found")); }