コード例 #1
0
        public async Task DeleteOrderDetailCommand_Ok()
        {
            var command = new DeleteOrderDetailCommand()
            {
                OrderID = 111036, ProductID = 59
            };
            var commandExcution = new DeleteOrderDetailCommand.DeleteOrderDetailCommandHandler(_context).Handle(command, CancellationToken.None);
            var entityExists    = await _context.OrderDetails.AnyAsync(x => x.OrderId == command.OrderID && x.ProductId == command.ProductID);

            Assert.True(!entityExists);
        }
コード例 #2
0
 public async Task <IActionResult> Delete(DeleteOrderDetailCommand deleteOrderDetailCommand)
 {
     return(Ok(await Mediator.Send(deleteOrderDetailCommand)));
 }