public async Task <ActionResult> Details(int?id) { if (id == null) { return(RedirectToAction("Index", "Posts")); } var profile = await _profilesService.GetProfileWithPostsById(id.Value); return(View(profile)); }