public ActionResult AddPost(Core.Models.Post model) { PostServiceClient service = new PostServiceClient(); Post p = new Post(); p.createdAt = new DateTime(); p.item = new Item() {category = new Category() { categoryId = 1, name = "categoria", status = 1 } }; p.user = new User() { userId = ((Core.UserServiceService.User)Session["currentUser"]).userId }; p.place = new Place() { city = "Sampa", name = "teste", placeId = 1 }; p.legend = model.legend; p.item.description = model.item.description; p.item.category.categoryId = model.item.category.categoryId; service.save(p); return RedirectToAction("Index"); }
public ActionResult Save(Post post) { PostServiceClient service = new PostServiceClient(); service.save(post); return RedirectToAction("FindPost"); }