// GET: Spotz/Details/5 public async Task <ActionResult> Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Spotz spotz = await _db.Spotzes.FindAsync(id); if (spotz == null) { return(HttpNotFound()); } var vm = new SpotzDetailViewModel(spotz); return(View(vm)); }
// GET: Spotz/Details/5 public async Task <ActionResult> Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var spotz = await _dbRepository.GetSpotzAsync(id.Value); if (spotz == null) { return(HttpNotFound()); } var vm = new SpotzDetailViewModel(spotz); return(View(vm)); }