public IActionResult SavePage() { _postServices.SavePost(_post); return(Json(true)); }
public async Task <IActionResult> Create([Bind("Post, Photo, SelectedCategories")] CreatePostViewModel createPostViewModel, [FromServices] IPostCategoryServices postCategoryServices, [FromServices] ICategoryServices categoryServices) { if (ModelState.IsValid) { await postServices.SavePost(createPostViewModel.Post, createPostViewModel.Photo); await SavePostCategory(createPostViewModel, postCategoryServices, categoryServices); return(RedirectToAction("Index")); } return(View(createPostViewModel)); }