public async Task <IActionResult> EditShop(int id) { string route = $"api/Shop/{id}"; UriBuilder endPoint = new UriBuilder(Api); endPoint.Path = route; ShopModel shopModel = (await MvcHttpClient <ShopModel, dynamic> .GetAsync(endPoint.Uri)).Value; return(View(shopModel)); }
private async Task <ActionResult <ItemModel> > GetProductInformation(int id) { string route = $"api/Product/GetItem/{id}"; var endPoint = new UriBuilder(Api); endPoint.Path = route; try { ItemModel item = (await MvcHttpClient <ItemModel, dynamic> .GetAsync(endPoint.Uri)).Value; return(item); } catch (Exception ex) { return(new ItemModel()); } }
//useless for now public async Task <IActionResult> Index(int id) { string route = $"api/Shop/{id}"; UriBuilder endPoint = new UriBuilder(Api); endPoint.Path = route; ShopModel shopModel = (await MvcHttpClient <ShopModel, dynamic> .GetAsync(endPoint.Uri)).Value; if (shopModel != null) { return(View(shopModel)); } else { return(NotFound()); } }
public async Task <IActionResult> Product(int id) { string route = $"api/Product/GetItem/{id}"; var endPoint = new UriBuilder(Api); endPoint.Path = route; ItemModel item = (await MvcHttpClient <ItemModel, dynamic> .GetAsync(endPoint.Uri)).Value; if (item != null) { return(View(item)); } else { return(NotFound()); } }