public IActionResult createPost(PostMapDB list, string user, string textBox, string postName) { if (user != null && textBox != null && postName != null) { int post = list.addpost(user, textBox, postName); return(RedirectToAction("seePost", new { submit = post })); } else { Models.ErrorViewModel error = new Models.ErrorViewModel(); error.RequestId = "Create post error, one of the required values was empty"; return(View("Error", error)); } }
public IActionResult editPost(int Id, PostMapDB post) { IEnumerable <PostMapDB> postObj = post.getPostMapById(Id); return(View(postObj)); }
public IActionResult Index(PostMapDB list) { IEnumerable <PostMapDB> dataOfPosts = list.getAllPosts().OrderBy(x => x.Date); return(View(dataOfPosts)); }
public IActionResult editPost(int submit, string textBox, PostMapDB post) { post.updatePost(submit, textBox); return(RedirectToAction("seePost", new { submit = submit }));; }