From 001cc6919911f9dd8fdda1135695d73e0a1eaf19 Mon Sep 17 00:00:00 2001 From: Antonio Lanzolla Date: Mon, 30 Jan 2023 16:37:59 +0100 Subject: [PATCH 1/5] #778 added item template in order to create new command from dotnet new --- .template.config/template.json | 1 + .../.template.config/icon.png | Bin 0 -> 20249 bytes .../.template.config/template.json | 50 ++++++++++++++++++ .../CleanArchitectureCommandCommand.cs | 24 +++++++++ ...leanArchitectureCommandCommandValidator.cs | 11 ++++ 5 files changed, 86 insertions(+) create mode 100644 templates/item-templates/create-command-template/.template.config/icon.png create mode 100644 templates/item-templates/create-command-template/.template.config/template.json create mode 100644 templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommand.cs create mode 100644 templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommandValidator.cs diff --git a/.template.config/template.json b/.template.config/template.json index 6212f5f6a..bcd4c09fb 100644 --- a/.template.config/template.json +++ b/.template.config/template.json @@ -53,6 +53,7 @@ "**/[Bb]in/**", "**/[Oo]bj/**", ".template.config/**/*", + "templates/**/*", ".vs/**/*", "**/*.filelist", "**/*.user", diff --git a/templates/item-templates/create-command-template/.template.config/icon.png b/templates/item-templates/create-command-template/.template.config/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..68e954e1d269300460d060fc4e59bec6410afe89 GIT binary patch literal 20249 zcmV*9Kybf_P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!Te(IA(h9Y8iFAN z6L5k_C=NERxZAtZx^9&^2D8tZ5jo1>6MK8;)&VHzNh2Ht^5e#Kaf#x#uybBxj$ zp>dAJAdNm6Jv6#$^y^F;ZEf9`pmQIO;tK!|(A2mmz?hCnd;yJJG-1AhQ^Z+LH<+!A=o5m$HHqr3P z^U`TRFuXzIRT?ccUQX(PQwI*bCb@CATm8XKE)=pkH8r*EQh4UN4tYH84_zg%cj zpph7%|3X?W3v2l-pauB=0ec598=WO+Bw0d_vm}kUKFtR{P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)9V6q>i@d^!0`W6x%M_XE3rs>>A5qtsQ0Z1qylBkBpg*0~2fPg@)Lo`Um z=g=ZD9c=_v0MbM|rT_o{ literal 0 HcmV?d00001 diff --git a/templates/item-templates/create-command-template/.template.config/template.json b/templates/item-templates/create-command-template/.template.config/template.json new file mode 100644 index 000000000..c479620e3 --- /dev/null +++ b/templates/item-templates/create-command-template/.template.config/template.json @@ -0,0 +1,50 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Antonio Lanzolla", + "classifications": [ + "Web", + "SPA", + "ASP.NET", + "Clean Architecture" + ], + "name": "Create new command in Clean Architecture Solution", + "identity": "Clean.Architecture.Solution.CreateCommand.CSharp", + "groupIdentity": "Clean.Architecture.Solution.CreateCommand", + "description": "Create e new command in Clean Architecture Solution from", + "shortName": "ca-command", + "tags": { + "language": "C#", + "type": "item" + }, + "sourceName": "CleanArchitectureCommand", + "preferNameDirectory": false, + "symbols": { + "DefaultNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "CleanArchitecture.Application", + "defaultValue": "CleanArchitecture.Application" + }, + "aggregateName": + { + "type": "parameter", + "datatype": "string", + "isRequired": true, + "replaces": "AggregateName", + "fileRename": "AggregateName" + }, + "returnType": { + "type": "parameter", + "datatype": "string", + "isRequired": false, + "replaces": "Unit", + "defaultValue": "Unit" + } + }, + "sources": [ + { + "source": "./", + "target": "./" + } + ] +} \ No newline at end of file diff --git a/templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommand.cs b/templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommand.cs new file mode 100644 index 000000000..9f1fce55c --- /dev/null +++ b/templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommand.cs @@ -0,0 +1,24 @@ +using CleanArchitecture.Application.Common.Interfaces; +using MediatR; + +namespace CleanArchitecture.Application.AggregateName.Commands.CleanArchitectureCommand; + +public record CleanArchitectureCommandCommand : IRequest +{ + +} + +public class CleanArchitectureCommandCommandHandler : IRequestHandler +{ + private readonly IApplicationDbContext _context; + + public CleanArchitectureCommandCommandHandler(IApplicationDbContext context) + { + _context = context; + } + + public async Task Handle(CleanArchitectureCommandCommand request, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } +} diff --git a/templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommandValidator.cs b/templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommandValidator.cs new file mode 100644 index 000000000..68291927d --- /dev/null +++ b/templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommandValidator.cs @@ -0,0 +1,11 @@ +using FluentValidation; + +namespace CleanArchitecture.Application.AggregateName.Commands.CleanArchitectureCommand; + +public class CleanArchitectureCommandCommandValidator : AbstractValidator +{ + public CleanArchitectureCommandCommandValidator() + { + + } +} From f3566deee0f3958db94f903f13c374c83fa50f59 Mon Sep 17 00:00:00 2001 From: Jason Taylor Date: Wed, 28 Jun 2023 20:12:14 +1000 Subject: [PATCH 2/5] =?UTF-8?q?=E2=9C=A8=20Convert=20to=20use=20case=20sup?= =?UTF-8?q?port=20(add=20command=20or=20query).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 ++ .../.template.config/icon.png | Bin .../.template.config/template.json | 78 ++++++++++++++++++ .../CleanArchitectureUseCaseCommand.cs | 23 ++++++ ...leanArchitectureUseCaseCommandValidator.cs | 10 +++ .../CleanArchitectureUseCaseQuery.cs | 23 ++++++ ...CleanArchitectureUseCaseQueryValidator.cs} | 3 +- .../.template.config/template.json | 50 ----------- .../CleanArchitectureCommandCommand.cs | 24 ------ 9 files changed, 142 insertions(+), 76 deletions(-) rename templates/{item-templates/create-command-template => ca-use-case}/.template.config/icon.png (100%) create mode 100644 templates/ca-use-case/.template.config/template.json create mode 100644 templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommand.cs create mode 100644 templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommandValidator.cs create mode 100644 templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQuery.cs rename templates/{item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommandValidator.cs => ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQueryValidator.cs} (68%) delete mode 100644 templates/item-templates/create-command-template/.template.config/template.json delete mode 100644 templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommand.cs diff --git a/README.md b/README.md index 70b9d77bd..73e5f32b6 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,13 @@ The easiest way to get started is to install the [.NET template](https://www.nug 4. Run `dotnet new ca-sln -c --output ` to create a new project 5. Navigate to `YourProjectName/src/WebUI` and launch the project using `dotnet run` +## Creating Use Cases + +```bash +dotnet new ca-usecase -us command -n CreateTodoList -f TodoLists -r int +dotnet new ca-usecase -us query -n GetTodos -f TodoLists -r TodosVm +``` + ## Database The template is configured to use an in-memory database by default. This ensures that all users will be able to run the solution without needing to set up additional infrastructure (e.g. SQL Server). diff --git a/templates/item-templates/create-command-template/.template.config/icon.png b/templates/ca-use-case/.template.config/icon.png similarity index 100% rename from templates/item-templates/create-command-template/.template.config/icon.png rename to templates/ca-use-case/.template.config/icon.png diff --git a/templates/ca-use-case/.template.config/template.json b/templates/ca-use-case/.template.config/template.json new file mode 100644 index 000000000..2006c8983 --- /dev/null +++ b/templates/ca-use-case/.template.config/template.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "JasonTaylorDev", + "classifications": [ + "Clean Architecture" + ], + "name": "Clean Architecture Solution Use Case", + "description": "Create a new use case (query or command)", + "identity": "Clean.Architecture.Solution.UseCase.CSharp", + "groupIdentity": "Clean.Architecture.Solution.UseCase", + "shortName": "ca-usecase", + "tags": { + "language": "C#", + "type": "item" + }, + "sourceName": "CleanArchitectureUseCase", + "preferNameDirectory": false, + "symbols": { + "DefaultNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "CleanArchitecture.Application", + "defaultValue": "CleanArchitecture.Application" + }, + "featureName": { + "type": "parameter", + "datatype": "string", + "isRequired": true, + "replaces": "FeatureName", + "fileRename": "FeatureName" + }, + "useCaseType": { + "type": "parameter", + "datatype": "choice", + "isRequired": true, + "choices": [ + { + "choice": "command", + "description": "Create a new command" + }, + { + "choice": "query", + "description": "Create a new query" + } + ], + "description": "The type of use case to create" + }, + "createCommand": { + "type": "computed", + "value": "(useCaseType == \"command\")" + }, + "createQuery": { + "type": "computed", + "value": "(useCaseType == \"query\")" + }, + "returnType": { + "type": "parameter", + "datatype": "string", + "isRequired": false, + "replaces": "object", + "defaultValue": "object" + } + }, + "sources": [ + { + "modifiers": [ + { + "condition": "(createCommand)", + "exclude": [ "FeatureName/Queries/**/*" ] + }, + { + "condition": "(createQuery)", + "exclude": [ "FeatureName/Commands/**/*" ] + } + ] + } + ] +} \ No newline at end of file diff --git a/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommand.cs b/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommand.cs new file mode 100644 index 000000000..617c081bc --- /dev/null +++ b/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommand.cs @@ -0,0 +1,23 @@ +using CleanArchitecture.Application.Common.Interfaces; +using MediatR; + +namespace CleanArchitecture.Application.FeatureName.Commands.CleanArchitectureUseCase; + +public record CleanArchitectureUseCaseCommand : IRequest +{ +} + +public class CleanArchitectureUseCaseCommandHandler : IRequestHandler +{ + private readonly IApplicationDbContext _context; + + public CleanArchitectureUseCaseCommandHandler(IApplicationDbContext context) + { + _context = context; + } + + public async Task Handle(CleanArchitectureUseCaseCommand request, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } +} diff --git a/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommandValidator.cs b/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommandValidator.cs new file mode 100644 index 000000000..2fb7dbb9c --- /dev/null +++ b/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommandValidator.cs @@ -0,0 +1,10 @@ +using FluentValidation; + +namespace CleanArchitecture.Application.FeatureName.Commands.CleanArchitectureUseCase; + +public class CleanArchitectureUseCaseCommandValidator : AbstractValidator +{ + public CleanArchitectureUseCaseCommandValidator() + { + } +} diff --git a/templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQuery.cs b/templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQuery.cs new file mode 100644 index 000000000..54108f8bb --- /dev/null +++ b/templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQuery.cs @@ -0,0 +1,23 @@ +using CleanArchitecture.Application.Common.Interfaces; +using MediatR; + +namespace CleanArchitecture.Application.FeatureName.Queries.CleanArchitectureUseCase; + +public record CleanArchitectureUseCaseQuery : IRequest +{ +} + +public class CleanArchitectureUseCaseQueryHandler : IRequestHandler +{ + private readonly IApplicationDbContext _context; + + public CleanArchitectureUseCaseQueryHandler(IApplicationDbContext context) + { + _context = context; + } + + public async Task Handle(CleanArchitectureUseCaseQuery request, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } +} diff --git a/templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommandValidator.cs b/templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQueryValidator.cs similarity index 68% rename from templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommandValidator.cs rename to templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQueryValidator.cs index 68291927d..531223af4 100644 --- a/templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommandValidator.cs +++ b/templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQueryValidator.cs @@ -1,11 +1,10 @@ using FluentValidation; -namespace CleanArchitecture.Application.AggregateName.Commands.CleanArchitectureCommand; +namespace CleanArchitecture.Application.FeatureName.Commands.CleanArchitectureCommand; public class CleanArchitectureCommandCommandValidator : AbstractValidator { public CleanArchitectureCommandCommandValidator() { - } } diff --git a/templates/item-templates/create-command-template/.template.config/template.json b/templates/item-templates/create-command-template/.template.config/template.json deleted file mode 100644 index c479620e3..000000000 --- a/templates/item-templates/create-command-template/.template.config/template.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/template", - "author": "Antonio Lanzolla", - "classifications": [ - "Web", - "SPA", - "ASP.NET", - "Clean Architecture" - ], - "name": "Create new command in Clean Architecture Solution", - "identity": "Clean.Architecture.Solution.CreateCommand.CSharp", - "groupIdentity": "Clean.Architecture.Solution.CreateCommand", - "description": "Create e new command in Clean Architecture Solution from", - "shortName": "ca-command", - "tags": { - "language": "C#", - "type": "item" - }, - "sourceName": "CleanArchitectureCommand", - "preferNameDirectory": false, - "symbols": { - "DefaultNamespace": { - "type": "bind", - "binding": "msbuild:RootNamespace", - "replaces": "CleanArchitecture.Application", - "defaultValue": "CleanArchitecture.Application" - }, - "aggregateName": - { - "type": "parameter", - "datatype": "string", - "isRequired": true, - "replaces": "AggregateName", - "fileRename": "AggregateName" - }, - "returnType": { - "type": "parameter", - "datatype": "string", - "isRequired": false, - "replaces": "Unit", - "defaultValue": "Unit" - } - }, - "sources": [ - { - "source": "./", - "target": "./" - } - ] -} \ No newline at end of file diff --git a/templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommand.cs b/templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommand.cs deleted file mode 100644 index 9f1fce55c..000000000 --- a/templates/item-templates/create-command-template/AggregateName/Commands/CleanArchitectureCommand/CleanArchitectureCommandCommand.cs +++ /dev/null @@ -1,24 +0,0 @@ -using CleanArchitecture.Application.Common.Interfaces; -using MediatR; - -namespace CleanArchitecture.Application.AggregateName.Commands.CleanArchitectureCommand; - -public record CleanArchitectureCommandCommand : IRequest -{ - -} - -public class CleanArchitectureCommandCommandHandler : IRequestHandler -{ - private readonly IApplicationDbContext _context; - - public CleanArchitectureCommandCommandHandler(IApplicationDbContext context) - { - _context = context; - } - - public async Task Handle(CleanArchitectureCommandCommand request, CancellationToken cancellationToken) - { - throw new NotImplementedException(); - } -} From 409cafcee9ba6bf5a9e73d0060d0790c45f57a4f Mon Sep 17 00:00:00 2001 From: Jason Taylor Date: Wed, 28 Jun 2023 21:47:44 +1000 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=93=9D=20Update=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 73e5f32b6..49a5115a0 100644 --- a/README.md +++ b/README.md @@ -19,20 +19,38 @@ The goal of this template is to provide a straightforward and efficient approach * [FluentValidation](https://fluentvalidation.net/) * [NUnit](https://nunit.org/), [FluentAssertions](https://fluentassertions.com/), [Moq](https://github.com/moq) & [Respawn](https://github.com/jbogard/Respawn) +## Dependencies +The template depends on the latest versions of: + +* [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) +* [Node.js LTS](https://nodejs.org/en/) + ## Getting Started -The easiest way to get started is to install the [.NET template](https://www.nuget.org/packages/Clean.Architecture.Solution.Template) and run `dotnet new ca-sln`: +The easiest way to get started is to install the [.NET template](https://www.nuget.org/packages/Clean.Architecture.Solution.Template): +``` +dotnet new install Clean.Architecture.Solution.Template::8.0.0-preview.5.1 +```` + +Once installed, create a new solution using the template: +``` +dotnet new ca-sln -c --output +``` + +The above command creates a SPA with Angular or React on ASP.NET Core. Start the application by navigating to `./src/WebUI` and running: +``` +dotnet run +``` -1. Install the latest versions of [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) and [Node.js LTS](https://nodejs.org/en/) -2. Run `dotnet new install Clean.Architecture.Solution.Template::8.0.0-preview.5.1` to install the .NET template -4. Run `dotnet new ca-sln -c --output ` to create a new project -5. Navigate to `YourProjectName/src/WebUI` and launch the project using `dotnet run` +Create use cases (commands or queries) by navigating to `./src/Application`, and running: +``` +dotnet new ca-usecase --feature TodoLists --name CreateTodoList --useCaseType command --returnType int +``` -## Creating Use Cases +To learn more, run the following command: -```bash -dotnet new ca-usecase -us command -n CreateTodoList -f TodoLists -r int -dotnet new ca-usecase -us query -n GetTodos -f TodoLists -r TodosVm +``` +dotnet new ca-usecase --help ``` ## Database From 223475dfbbf1674018234e3e6ca0396683f6bc27 Mon Sep 17 00:00:00 2001 From: Jason Taylor Date: Thu, 29 Jun 2023 13:33:29 +1000 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=94=96=20Release=208.0.0-preview5.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CleanArchitecture.nuspec | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CleanArchitecture.nuspec b/CleanArchitecture.nuspec index 40e597b84..3a4152625 100644 --- a/CleanArchitecture.nuspec +++ b/CleanArchitecture.nuspec @@ -3,7 +3,7 @@ Clean.Architecture.Solution.Template - 8.0.0-preview.5.1 + 8.0.0-preview.5.2 Clean Architecture Solution Template JasonTaylorDev Clean Architecture Solution Template for .NET 8. @@ -11,7 +11,7 @@ A Clean Architecture Solution Template for creating a Single-Page Application (SPA) with ASP.NET Core. - Added support for React. + Added item template for creating use cases (commands and queries) https://github.com/JasonTaylorDev/CleanArchitecture diff --git a/README.md b/README.md index 49a5115a0..c62c6fb25 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The template depends on the latest versions of: The easiest way to get started is to install the [.NET template](https://www.nuget.org/packages/Clean.Architecture.Solution.Template): ``` -dotnet new install Clean.Architecture.Solution.Template::8.0.0-preview.5.1 +dotnet new install Clean.Architecture.Solution.Template::8.0.0-preview.5.2 ```` Once installed, create a new solution using the template: From 40e2c4aa17af6a68a90f088ec0ac3c363a966ad3 Mon Sep 17 00:00:00 2001 From: Jason Taylor Date: Thu, 29 Jun 2023 16:25:51 +1000 Subject: [PATCH 5/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Adjust=20use=20case=20?= =?UTF-8?q?design?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...reUseCaseCommand.cs => CleanArchitectureUseCase.cs} | 8 +++++++- .../CleanArchitectureUseCaseCommandValidator.cs | 10 ---------- ...tureUseCaseQuery.cs => CleanArchitectureUseCase.cs} | 8 +++++++- .../CleanArchitectureUseCaseQueryValidator.cs | 10 ---------- 4 files changed, 14 insertions(+), 22 deletions(-) rename templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/{CleanArchitectureUseCaseCommand.cs => CleanArchitectureUseCase.cs} (79%) delete mode 100644 templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommandValidator.cs rename templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/{CleanArchitectureUseCaseQuery.cs => CleanArchitectureUseCase.cs} (78%) delete mode 100644 templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQueryValidator.cs diff --git a/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommand.cs b/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCase.cs similarity index 79% rename from templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommand.cs rename to templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCase.cs index 617c081bc..18226bed3 100644 --- a/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommand.cs +++ b/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCase.cs @@ -1,5 +1,4 @@ using CleanArchitecture.Application.Common.Interfaces; -using MediatR; namespace CleanArchitecture.Application.FeatureName.Commands.CleanArchitectureUseCase; @@ -7,6 +6,13 @@ public record CleanArchitectureUseCaseCommand : IRequest { } +public class CleanArchitectureUseCaseCommandValidator : AbstractValidator +{ + public CleanArchitectureUseCaseCommandValidator() + { + } +} + public class CleanArchitectureUseCaseCommandHandler : IRequestHandler { private readonly IApplicationDbContext _context; diff --git a/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommandValidator.cs b/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommandValidator.cs deleted file mode 100644 index 2fb7dbb9c..000000000 --- a/templates/ca-use-case/FeatureName/Commands/CleanArchitectureUseCase/CleanArchitectureUseCaseCommandValidator.cs +++ /dev/null @@ -1,10 +0,0 @@ -using FluentValidation; - -namespace CleanArchitecture.Application.FeatureName.Commands.CleanArchitectureUseCase; - -public class CleanArchitectureUseCaseCommandValidator : AbstractValidator -{ - public CleanArchitectureUseCaseCommandValidator() - { - } -} diff --git a/templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQuery.cs b/templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCase.cs similarity index 78% rename from templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQuery.cs rename to templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCase.cs index 54108f8bb..47470ec08 100644 --- a/templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQuery.cs +++ b/templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCase.cs @@ -1,5 +1,4 @@ using CleanArchitecture.Application.Common.Interfaces; -using MediatR; namespace CleanArchitecture.Application.FeatureName.Queries.CleanArchitectureUseCase; @@ -7,6 +6,13 @@ public record CleanArchitectureUseCaseQuery : IRequest { } +public class CleanArchitectureCommandCommandValidator : AbstractValidator +{ + public CleanArchitectureCommandCommandValidator() + { + } +} + public class CleanArchitectureUseCaseQueryHandler : IRequestHandler { private readonly IApplicationDbContext _context; diff --git a/templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQueryValidator.cs b/templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQueryValidator.cs deleted file mode 100644 index 531223af4..000000000 --- a/templates/ca-use-case/FeatureName/Queries/CleanArchitectureUseCase/CleanArchitectureUseCaseQueryValidator.cs +++ /dev/null @@ -1,10 +0,0 @@ -using FluentValidation; - -namespace CleanArchitecture.Application.FeatureName.Commands.CleanArchitectureCommand; - -public class CleanArchitectureCommandCommandValidator : AbstractValidator -{ - public CleanArchitectureCommandCommandValidator() - { - } -}