moved files individually.
This commit is contained in:
parent
de98b3b472
commit
bd1b948a19
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
14
Demo/Commands/CreatePersonCommandHandler.cs
Normal file
14
Demo/Commands/CreatePersonCommandHandler.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
13
Demo/Commands/CreatePersonCommandValidator.cs
Normal file
13
Demo/Commands/CreatePersonCommandValidator.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user