public async Task <IActionResult> Details(int?id) { if (id == null) { return(BadRequest("Rental company ID wasn't set")); } try { var rentalCompany = await service.GetRentalCompanyAsync(id); return(View(rentalCompany.Adapt <RentalCompanyVM>())); } catch { return(NotFound()); } }