aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/add-feature-template.sh18
1 files changed, 6 insertions, 12 deletions
diff --git a/tools/add-feature-template.sh b/tools/add-feature-template.sh
index dd3d764..3a8695b 100755
--- a/tools/add-feature-template.sh
+++ b/tools/add-feature-template.sh
@@ -359,9 +359,6 @@ namespace $project_name.Web.Controllers
{
${feature_name}ServiceModel serviceModel = await this._service.GetByIdAsync(Guid.Parse(id));
- if (serviceModel == null)
- return RedirectToAction("Index", "Home");
-
${feature_name}WebModel webModel = this._autoMapper.Map<${feature_name}WebModel>(serviceModel);
return View(webModel);
}
@@ -381,9 +378,9 @@ namespace $project_name.Web.Controllers
bool result = await this._service.CreateAsync(serviceModel);
if (result)
- return RedirectToAction("Profile", "Account");
+ return RedirectToAction("Index");
else
- return RedirectToAction("Index", "Home");
+ return RedirectToAction("Create");
}
[HttpGet]
@@ -391,9 +388,6 @@ namespace $project_name.Web.Controllers
{
${feature_name}ServiceModel serviceModel = await this._service.GetByIdAsync(Guid.Parse(id));
- if (serviceModel == null)
- return RedirectToAction("Index", "Home");
-
Edit${feature_name}WebModel edit${feature_name}WebModel = this._autoMapper.Map<Edit${feature_name}WebModel>(serviceModel);
return View(edit${feature_name}WebModel);
}
@@ -406,9 +400,9 @@ namespace $project_name.Web.Controllers
bool result = await this._service.EditAsync(serviceModel);
if (result)
- return RedirectToAction("Index", new { id = webModel.Id.ToString() });
+ return RedirectToAction("Details", new { id = webModel.Id.ToString() });
else
- return RedirectToAction("Index", "Home");
+ return RedirectToAction("Edit", new { id = webModel.Id.ToString() });
}
[HttpGet]
@@ -423,9 +417,9 @@ namespace $project_name.Web.Controllers
bool result = await this._service.DeleteAsync(Guid.Parse(id));
if (result)
- return RedirectToAction("Index", "Home");
+ return RedirectToAction("Index");
else
- return RedirectToAction("Index", new { id = id });
+ return RedirectToAction("Delete", new { id = id });
}
}
}