コード例 #1
0
        public async Task Handle_ShouldPersistExampleChildList()
        {
            var command = new CreateExampleParentCommand
            {
                Parent = new ExampleParentDto {
                    Name = "CreateTest"
                }
            };

            var handler = new CreateExampleParentCommand.CreateExampleParentCommandHandler(Context);

            var result = await handler.Handle(command, CancellationToken.None);

            var entity = Context.ExampleParents.Find(result);

            entity.Should().NotBeNull();
            entity.Name.Should().Be(command.Parent.Name);
        }
コード例 #2
0
 public async Task <ActionResult <int> > Create(CreateExampleParentCommand command)
 {
     return(await Mediator.Send(command));
 }