public async Task <IActionResult> Create(PostViewModel model) { if (ModelState.IsValid) { await _databaseProvider.AddPost(model); return(Redirect(nameof(Index))); } return(View(model)); }