public async Task <IActionResult> OnGetAsync(string orderid) { Console.WriteLine($"Your orderid is {orderid}"); var orderQuery = new Client.Entities.Order((CRMClient)_crmClient); var result = await orderQuery.List <Client.Types.OrderBase>(orderQuery.GetByOrderIDQuery(orderid)); if (result != null && result.Count > 0) { order = result[0]; return(Page()); } // FIXME: This NotFound is very rough: it says webpage cannot be found as a server response not an app response Console.WriteLine($"Not found {orderid}"); return(NotFound($"Order by id {orderid} has not been found.")); }
/// <summary> /// Get orders of a Contact /// </summary> /// <param name="id"></param> /// <returns></returns> public async Task <IActionResult> GetOrders(Guid id) { if (id == Guid.Empty) { return(NotFound()); } Client.Entities.Order order = new Client.Entities.Order((CRMClient)_crmClient); var result = await order.ListOrdersOfContact(id); if (result != null) { return(View(result)); } return(NotFound()); }