moved files individually.
This commit is contained in:
@@ -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<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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -68,9 +68,8 @@ namespace Demo
|
||||
|
||||
services
|
||||
.AddTransient<IQueryableProvider<Person>, PersonQueryableProvider>()
|
||||
.AddDynamicQuery<Person, PersonModel>("People")
|
||||
.AddDynamicQueryInterceptor<Person, PersonModel, PersonConvertInterceptor>()
|
||||
.AddDynamicQueryInterceptor<Person, PersonModel, PersonOptimizationInterceptor>();
|
||||
.AddDynamicQuery<Person, PersonModel>(name: "People")
|
||||
.AddDynamicQueryInterceptors<Person, PersonModel, PersonConvertInterceptor, PersonOptimizationInterceptor>();
|
||||
}
|
||||
|
||||
private void AddCommands(IServiceCollection services)
|
||||
|
||||
Reference in New Issue
Block a user