public ActionResult Delete(Guid id, IFormCollection collection) { try { var result = _apiRepository.DeleteDevice(id); return(RedirectToAction("Index")); } catch { return(View()); } }