//Kutuların bulunduğu ana sayfayı açar. public ActionResult BoxesMainPage() { var model = _bs.GetBoxes().Result; if (model != null) { return(View(model)); } return(HttpNotFound()); }
public async Task <IActionResult> GetBoxes() { try { var boxes = await _boxService.GetBoxes(User.GetId()); return(Ok(boxes)); } catch (BoxNotFoundException) { _logger.LogWarning($"Failed to get boxes for user {User.GetId()}"); return(NotFound()); } catch (Exception e) { _logger.LogError(e.ToString()); return(new InternalServerErrorResult()); } }