From a2b4dc764a3bab0756803c992873ae6ece621f0f Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 12 May 2021 14:39:24 +0300 Subject: Add feature template script now adds a GetAll method in service (although web doesn't handle it in any way) --- tools/add-feature-template.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools') diff --git a/tools/add-feature-template.sh b/tools/add-feature-template.sh index edce00d..a85cb7a 100755 --- a/tools/add-feature-template.sh +++ b/tools/add-feature-template.sh @@ -105,6 +105,13 @@ namespace $project_name.Services return this._autoMapper.Map<${feature_name}ServiceModel>(curr$feature_name); } + public List<${feature_name}ServiceModel> GetAll() + { + return this._context.${feature_name}s + .Select(x => this._autoMapper.Map<${feature_name}ServiceModel>(x)) + .ToList(); + } + public async Task EditAsync(Edit${feature_name}ServiceModel edit${feature_name}ServiceModel) { $feature_name curr$feature_name = this._autoMapper.Map<$feature_name>(edit${feature_name}ServiceModel); -- cgit v1.2.3