aboutsummaryrefslogtreecommitdiff
path: root/tools/add-feature-template.sh
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-05-12 14:23:59 +0300
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-05-12 14:23:59 +0300
commitfc43ff3c98bad3f0c6df31dddefd192bdab9a77f (patch)
tree5460c87a6d6f27610652e93e87d2c41acf7cf2b3 /tools/add-feature-template.sh
parent15467d5c0a24febfed4edfd33039b48898b8dfcc (diff)
downloadit-kariera-exam-template-fc43ff3c98bad3f0c6df31dddefd192bdab9a77f.tar
it-kariera-exam-template-fc43ff3c98bad3f0c6df31dddefd192bdab9a77f.tar.gz
it-kariera-exam-template-fc43ff3c98bad3f0c6df31dddefd192bdab9a77f.zip
Moved the Guid Id to it's own base models
Diffstat (limited to 'tools/add-feature-template.sh')
-rwxr-xr-xtools/add-feature-template.sh28
1 files changed, 19 insertions, 9 deletions
diff --git a/tools/add-feature-template.sh b/tools/add-feature-template.sh
index bf9d8ac..edce00d 100755
--- a/tools/add-feature-template.sh
+++ b/tools/add-feature-template.sh
@@ -26,9 +26,8 @@ using System;
namespace $project_name.Data.Models
{
- public class $feature_name
+ public class $feature_name : BaseModel
{
- public Guid Id { get; set; }
$(
for feature in "${features[@]}"; do
echo -e "\t\tpublic $feature { get; set; }"
@@ -145,17 +144,20 @@ models=("View" "" "Edit")
for model in "${models[@]}"
do
cat > $subdir/$model${feature_name}ServiceModel.cs<< EOF
-using System;
+using System;$(
+if [ ! -z $model ]; then
+echo -e "\nusing $project_name.Services.Models;"
+fi
+)
namespace $project_name.Services.Models.$feature_name
{
- public class $model${feature_name}ServiceModel
- {$(
+ public class $model${feature_name}ServiceModel$(
if [ ! -z $model ]; then
-echo -e "\n\t\tpublic Guid Id { get; set; }"
+echo -e ' : BaseServiceModel'
fi
)
-$(
+ {$(
for feature in "${features[@]}"; do
echo -e "\t\tpublic $feature { get; set; }"
done
@@ -224,11 +226,19 @@ models=("View" "" "Edit")
for model in "${models[@]}"
do
cat > $subdir/$model${feature_name}WebModel.cs<< EOF
-using System;
+using System;$(
+if [ ! -z $model ]; then
+echo -e "\nusing $project_name.Web.Models;"
+fi
+)
namespace $project_name.Web.Models.$feature_name
{
- public class $model${feature_name}WebModel
+ public class $model${feature_name}WebModel$(
+if [ ! -z $model ]; then
+echo -e ' : BaseWebModel'
+fi
+)
{$(
if [ ! -z $model ]; then
echo -e "\n\t\tpublic Guid Id { get; set; }"