moved files individually.

This commit is contained in:
David Lebee 2021-02-03 10:50:28 -05:00
parent de98b3b472
commit bd1b948a19
4 changed files with 30 additions and 25 deletions

View File

@ -1,10 +1,6 @@
using FluentValidation; using System;
using PoweredSoft.CQRS.Abstractions;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Demo.Commands namespace Demo.Commands
{ {
@ -13,21 +9,4 @@ namespace Demo.Commands
public string FirstName { get; set; } public string FirstName { get; set; }
public string LastName { get; set; } public string LastName { get; set; }
} }
public class CreatePersonCommandValidator : AbstractValidator<CreatePersonCommand>
{
public CreatePersonCommandValidator()
{
RuleFor(t => t.FirstName).NotEmpty();
RuleFor(t => t.LastName).NotEmpty();
}
}
public class CreatePersonCommandHandler : ICommandHandler<CreatePersonCommand>
{
public Task HandleAsync(CreatePersonCommand command, CancellationToken cancellationToken = default)
{
return Task.CompletedTask;
}
}
} }

View File

@ -0,0 +1,14 @@
using PoweredSoft.CQRS.Abstractions;
using System.Threading;
using System.Threading.Tasks;
namespace Demo.Commands
{
public class CreatePersonCommandHandler : ICommandHandler<CreatePersonCommand>
{
public Task HandleAsync(CreatePersonCommand command, CancellationToken cancellationToken = default)
{
return Task.CompletedTask;
}
}
}

View File

@ -0,0 +1,13 @@
using FluentValidation;
namespace Demo.Commands
{
public class CreatePersonCommandValidator : AbstractValidator<CreatePersonCommand>
{
public CreatePersonCommandValidator()
{
RuleFor(t => t.FirstName).NotEmpty();
RuleFor(t => t.LastName).NotEmpty();
}
}
}

View File

@ -68,9 +68,8 @@ namespace Demo
services services
.AddTransient<IQueryableProvider<Person>, PersonQueryableProvider>() .AddTransient<IQueryableProvider<Person>, PersonQueryableProvider>()
.AddDynamicQuery<Person, PersonModel>("People") .AddDynamicQuery<Person, PersonModel>(name: "People")
.AddDynamicQueryInterceptor<Person, PersonModel, PersonConvertInterceptor>() .AddDynamicQueryInterceptors<Person, PersonModel, PersonConvertInterceptor, PersonOptimizationInterceptor>();
.AddDynamicQueryInterceptor<Person, PersonModel, PersonOptimizationInterceptor>();
} }
private void AddCommands(IServiceCollection services) private void AddCommands(IServiceCollection services)