From bd1b948a194d1b70c7cc238fa3e7217cabe07d62 Mon Sep 17 00:00:00 2001 From: David Lebee Date: Wed, 3 Feb 2021 10:50:28 -0500 Subject: [PATCH] moved files individually. --- Demo/Commands/CreatePersonCommand.cs | 23 +------------------ Demo/Commands/CreatePersonCommandHandler.cs | 14 +++++++++++ Demo/Commands/CreatePersonCommandValidator.cs | 13 +++++++++++ Demo/Startup.cs | 5 ++-- 4 files changed, 30 insertions(+), 25 deletions(-) create mode 100644 Demo/Commands/CreatePersonCommandHandler.cs create mode 100644 Demo/Commands/CreatePersonCommandValidator.cs diff --git a/Demo/Commands/CreatePersonCommand.cs b/Demo/Commands/CreatePersonCommand.cs index a04a162..57ce293 100644 --- a/Demo/Commands/CreatePersonCommand.cs +++ b/Demo/Commands/CreatePersonCommand.cs @@ -1,10 +1,6 @@ -using FluentValidation; -using PoweredSoft.CQRS.Abstractions; -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Threading; -using System.Threading.Tasks; namespace Demo.Commands { @@ -13,21 +9,4 @@ namespace Demo.Commands public string FirstName { get; set; } public string LastName { get; set; } } - - public class CreatePersonCommandValidator : AbstractValidator - { - public CreatePersonCommandValidator() - { - RuleFor(t => t.FirstName).NotEmpty(); - RuleFor(t => t.LastName).NotEmpty(); - } - } - - public class CreatePersonCommandHandler : ICommandHandler - { - public Task HandleAsync(CreatePersonCommand command, CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - } } diff --git a/Demo/Commands/CreatePersonCommandHandler.cs b/Demo/Commands/CreatePersonCommandHandler.cs new file mode 100644 index 0000000..e542a95 --- /dev/null +++ b/Demo/Commands/CreatePersonCommandHandler.cs @@ -0,0 +1,14 @@ +using PoweredSoft.CQRS.Abstractions; +using System.Threading; +using System.Threading.Tasks; + +namespace Demo.Commands +{ + public class CreatePersonCommandHandler : ICommandHandler + { + public Task HandleAsync(CreatePersonCommand command, CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + } +} diff --git a/Demo/Commands/CreatePersonCommandValidator.cs b/Demo/Commands/CreatePersonCommandValidator.cs new file mode 100644 index 0000000..12498a9 --- /dev/null +++ b/Demo/Commands/CreatePersonCommandValidator.cs @@ -0,0 +1,13 @@ +using FluentValidation; + +namespace Demo.Commands +{ + public class CreatePersonCommandValidator : AbstractValidator + { + public CreatePersonCommandValidator() + { + RuleFor(t => t.FirstName).NotEmpty(); + RuleFor(t => t.LastName).NotEmpty(); + } + } +} diff --git a/Demo/Startup.cs b/Demo/Startup.cs index bf53d9d..988a41a 100644 --- a/Demo/Startup.cs +++ b/Demo/Startup.cs @@ -68,9 +68,8 @@ namespace Demo services .AddTransient, PersonQueryableProvider>() - .AddDynamicQuery("People") - .AddDynamicQueryInterceptor() - .AddDynamicQueryInterceptor(); + .AddDynamicQuery(name: "People") + .AddDynamicQueryInterceptors(); } private void AddCommands(IServiceCollection services)