aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-05-12 15:13:52 +0300
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-05-12 15:13:52 +0300
commit34eb4779506485928ccbe6efc360604da5333fd8 (patch)
treecc0e23389e2ad707f0c89208002887c2289bf679
parent04bae6833b7276ae708da994364c9f6ee8392a35 (diff)
downloadit-kariera-exam-template-34eb4779506485928ccbe6efc360604da5333fd8.tar
it-kariera-exam-template-34eb4779506485928ccbe6efc360604da5333fd8.tar.gz
it-kariera-exam-template-34eb4779506485928ccbe6efc360604da5333fd8.zip
Fixed add feature template model creation and model ids
-rwxr-xr-xtools/add-feature-template.sh18
1 files changed, 7 insertions, 11 deletions
diff --git a/tools/add-feature-template.sh b/tools/add-feature-template.sh
index a85cb7a..87b556f 100755
--- a/tools/add-feature-template.sh
+++ b/tools/add-feature-template.sh
@@ -147,12 +147,12 @@ EOF
subdir="$dir/Models/$feature_name"
mkdir -p $subdir
-models=("View" "" "Edit")
+models=("" "Create" "Edit")
for model in "${models[@]}"
do
cat > $subdir/$model${feature_name}ServiceModel.cs<< EOF
using System;$(
-if [ ! -z $model ]; then
+if [ $model != "Create" ]; then
echo -e "\nusing $project_name.Services.Models;"
fi
)
@@ -160,7 +160,7 @@ fi
namespace $project_name.Services.Models.$feature_name
{
public class $model${feature_name}ServiceModel$(
-if [ ! -z $model ]; then
+if [ $model != "Create" ]; then
echo -e ' : BaseServiceModel'
fi
)
@@ -229,12 +229,12 @@ fi
subdir="$dir/Models/$feature_name"
mkdir -p $subdir
-models=("View" "" "Edit")
+models=("" "Create" "Edit")
for model in "${models[@]}"
do
cat > $subdir/$model${feature_name}WebModel.cs<< EOF
using System;$(
-if [ ! -z $model ]; then
+if [ $model != "Create" ]; then
echo -e "\nusing $project_name.Web.Models;"
fi
)
@@ -242,15 +242,11 @@ fi
namespace $project_name.Web.Models.$feature_name
{
public class $model${feature_name}WebModel$(
-if [ ! -z $model ]; then
+if [ $model != "Create" ]; then
echo -e ' : BaseWebModel'
fi
)
- {$(
-if [ ! -z $model ]; then
-echo -e "\n\t\tpublic Guid Id { get; set; }"
-fi
-)
+ {
$(
for feature in "${features[@]}"; do
echo -e "\t\tpublic $feature { get; set; }"