public IActionResult Detail(int id) { var imageDetail = _imageService.GetById(id); var model = new ImageDetailViewModel() { ImageTitle = imageDetail.Title, ImageCreated = imageDetail.Created, ImageUrl = imageDetail.Url, ImageTags = imageDetail.Tags.Select(t => t.Description).ToList() }; return(View(model)); }
// GET: Ideaboard/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var ideaboard = await _context.Ideaboard .SingleOrDefaultAsync(m => m.IdeaboardId == id); if (ideaboard == null) { return(NotFound()); } var user = await GetCurrentUserAsync(); var model = new ImageDetailViewModel(_context, user, ideaboard.IdeaboardId); model.Ideaboard = ideaboard; return(View(model)); }