public async Task <IActionResult> GetProductById(Guid productId) { try { var _productResponse = await _getProduct.Execute(productId); return(Ok(_productResponse)); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError)); } }
// GET: Product public ActionResult Index() { getProduct.InputArgument = p => true; getProduct.Execute(); return(View(getProduct.OutputArgument)); }
// GET api/product public List <Product> Get() { getProduct.InputArgument = p => true; getProduct.Execute(); return(getProduct.OutputArgument); }