public async Task <IActionResult> Delete(int?id) { if (id != null) { var obj = await _parameterService.FindByIdAsync(id.Value); if (obj != null) { return(View(obj)); } } return(RedirectToAction(nameof(Error), new { message = "Id not provided" })); }