예제 #1
0
        public async Task <IActionResult> Delete([FromServices] BlogCommandHandlerFactory blogCommandHandlerFactory, int id)
        {
            var command = new DeleteBlogAsyncCommand {
                Id = id
            };
            var handler  = blogCommandHandlerFactory.Build(command);
            var response = await handler.Execute();

            return(Ok());
        }
 public DeleteBlogAsyncCommandHandler(ApplicationDbContext dbContext,
                                      IMapper mapper, DeleteBlogAsyncCommand command) : base(dbContext)
 {
     _mapper  = mapper;
     _command = command;
 }
예제 #3
0
 public ICommandHandler <DeleteBlogAsyncCommand, Task <CommandResponse> > Build(DeleteBlogAsyncCommand command)
 {
     return(new DeleteBlogAsyncCommandHandler(_context, _mapper, command));
 }