public IActionResult DisplayEquipmentHistory(int id) { // Assume the user is not authorized IActionResult result = Unauthorized(); try { EquipmentItem equip = _db.GetEquipmentById(id); IList <UsageItem> history = _db.GetEquipmentHistory(equip); result = Ok(history); } catch (Exception) { result = BadRequest(new { Message = "Get equipment history failed." }); } return(result); }