From 1691baf054b6695da35c9d29032d9b3934c1f979 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 May 2021 12:03:11 +0300 Subject: Renamed mapping classes to have the name of their layer --- .../Services/Configurations/ServiceUserMappings.cs | 15 +++++++++++++++ ExamTemplate/Services/Configurations/UserMappings.cs | 15 --------------- .../Web/Configurations/ControllerUserMappings.cs | 18 ++++++++++++++++++ ExamTemplate/Web/Configurations/UserMappings.cs | 18 ------------------ tools/add-feature-template.sh | 12 ++++++------ 5 files changed, 39 insertions(+), 39 deletions(-) create mode 100644 ExamTemplate/Services/Configurations/ServiceUserMappings.cs delete mode 100644 ExamTemplate/Services/Configurations/UserMappings.cs create mode 100644 ExamTemplate/Web/Configurations/ControllerUserMappings.cs delete mode 100644 ExamTemplate/Web/Configurations/UserMappings.cs diff --git a/ExamTemplate/Services/Configurations/ServiceUserMappings.cs b/ExamTemplate/Services/Configurations/ServiceUserMappings.cs new file mode 100644 index 0000000..787b90f --- /dev/null +++ b/ExamTemplate/Services/Configurations/ServiceUserMappings.cs @@ -0,0 +1,15 @@ +using AutoMapper; +using ExamTemplate.Data.Models; +using ExamTemplate.Services.Models.User; + +namespace ExamTemplate.Services.Configurations +{ + public class ServiceUserMappings : Profile + { + public ServiceUserMappings() + { + CreateMap(); + CreateMap(); + } + } +} diff --git a/ExamTemplate/Services/Configurations/UserMappings.cs b/ExamTemplate/Services/Configurations/UserMappings.cs deleted file mode 100644 index acb3ae4..0000000 --- a/ExamTemplate/Services/Configurations/UserMappings.cs +++ /dev/null @@ -1,15 +0,0 @@ -using AutoMapper; -using ExamTemplate.Data.Models; -using ExamTemplate.Services.Models.User; - -namespace ExamTemplate.Services.Configurations -{ - public class UserMappings : Profile - { - public UserMappings() - { - CreateMap(); - CreateMap(); - } - } -} diff --git a/ExamTemplate/Web/Configurations/ControllerUserMappings.cs b/ExamTemplate/Web/Configurations/ControllerUserMappings.cs new file mode 100644 index 0000000..0a797af --- /dev/null +++ b/ExamTemplate/Web/Configurations/ControllerUserMappings.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using ExamTemplate.Services.Models.User; +using ExamTemplate.Web.Models.User; + +namespace ExamTemplate.Services.Configurations +{ + public class ControllerUserMappings : Profile + { + public ControllerUserMappings() + { + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + } + } +} diff --git a/ExamTemplate/Web/Configurations/UserMappings.cs b/ExamTemplate/Web/Configurations/UserMappings.cs deleted file mode 100644 index 3f0f22c..0000000 --- a/ExamTemplate/Web/Configurations/UserMappings.cs +++ /dev/null @@ -1,18 +0,0 @@ -using AutoMapper; -using ExamTemplate.Services.Models.User; -using ExamTemplate.Web.Models.User; - -namespace ExamTemplate.Services.Configurations -{ - public class UserMappings : Profile - { - public UserMappings() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/tools/add-feature-template.sh b/tools/add-feature-template.sh index 9fea26a..d283563 100755 --- a/tools/add-feature-template.sh +++ b/tools/add-feature-template.sh @@ -169,16 +169,16 @@ done subdir="${dir}/Configurations" mappings=("Create${feature_name}ServiceModel, $feature_name" "$feature_name, ${feature_name}ServiceModel" "Edit${feature_name}ServiceModel, $feature_name") -cat > $subdir/${feature_name}Mappings.cs<< EOF +cat > $subdir/Service${feature_name}Mappings.cs<< EOF using AutoMapper; using $project_name.Data.Models; using $project_name.Services.Models.$feature_name; namespace $project_name.Services.Configurations { - public class ${feature_name}Mappings : Profile + public class Service${feature_name}Mappings : Profile { - public ${feature_name}Mappings() + public Service${feature_name}Mappings() { $( for map in "${mappings[@]}"; do @@ -439,16 +439,16 @@ EOF subdir="${dir}/Configurations" mappings=("${feature_name}ServiceModel, ${feature_name}ViewModel" "Create${feature_name}ViewModel, Create${feature_name}ServiceModel" "${feature_name}ServiceModel, Edit${feature_name}ViewModel" "Edit${feature_name}ViewModel, Edit${feature_name}ServiceModel") -cat > $subdir/${feature_name}Mappings.cs<< EOF +cat > $subdir/Controller${feature_name}Mappings.cs<< EOF using AutoMapper; using $project_name.Services.Models.$feature_name; using $project_name.Web.Models.$feature_name; namespace $project_name.Web.Configurations { - public class ${feature_name}Mappings : Profile + public class Controller${feature_name}Mappings : Profile { - public ${feature_name}Mappings() + public Controller${feature_name}Mappings() { $( for map in "${mappings[@]}"; do -- cgit v1.2.3