public async Task <IActionResult> GetPostLike([FromRoute] int id) { data.AddLike(id); var post = data.GetPost(id); data.commit(); return(CreatedAtAction("GetPost", new { id }, post)); }
public IActionResult OnGet(int PostId) { data.AddLike(PostId); data.commit(); return(RedirectToPage("./Post")); }