From 34eb4779506485928ccbe6efc360604da5333fd8 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 12 May 2021 15:13:52 +0300 Subject: Fixed add feature template model creation and model ids --- tools/add-feature-template.sh | 18 +++++++----------- 1 file 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; }" -- cgit v1.2.3