diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-05-12 15:13:52 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-05-12 15:13:52 +0300 |
| commit | 34eb4779506485928ccbe6efc360604da5333fd8 (patch) | |
| tree | cc0e23389e2ad707f0c89208002887c2289bf679 | |
| parent | 04bae6833b7276ae708da994364c9f6ee8392a35 (diff) | |
| download | it-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-x | tools/add-feature-template.sh | 18 |
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; }" |
