Mineplex2018-withcommit/Website/packages/MvcScaffolding.1.0.7/tools/Action/ActionPost.cs.t4

11 lines
486 B
Plaintext
Raw Normal View History

2013-08-27 17:14:08 +02:00
<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #>
<# var viewModel = (EnvDTE.CodeType)Model.ViewModel; #>
[HttpPost, ActionName("<#= Model.Action #>")]
public ActionResult <#= Model.Action #>Post(<# if (viewModel != null) { #><#= viewModel.Name #> <#= viewModel.Name.ToLower() #><# } #>)
{
if (ModelState.IsValid) {
return RedirectToAction("Index");
} else {
return View(<# if (viewModel != null) { #><#= viewModel.Name.ToLower() #><# } #>);
}
}