public async Task <IActionResult> Post(int id) { if (id != 0) { Post post = postContext.GetById(id); if (User.Identity.Name != null) { Gebruiker huidigeGebruiker = await gebruikerContext.GetByNaam(User.Identity.Name); postContext.RecordCategoryVisit(post.Categorie, huidigeGebruiker); } return(View(post)); } return(View(null)); }
public Post GetById(int id) { PostDTO dto = new PostDTO(); dto = context.GetById(id); Post post = converter.DtoToModel(dto); return(post); }
public IActionResult GetById([FromQuery] int id) { Post post = postContext.GetById(id); if (post == null) { return(NotFound()); } return(new ObjectResult(post)); }
public Post GetById(int id) { return(context.GetById(id)); }