public IActionResult Index() { try { return(StatusCode(200, api.GetAllProducts())); } catch (Exception e) { return(StatusCode(400, e.Message)); } }
public IActionResult Index() { return(View(api.GetAllProducts())); }