示例#1
0
        public async Task <ICommandResult> Handle(DeleteSectorCommand command)
        {
            Sector Sector = await _SectorRepository.GetById(command.Id);

            if (Sector == null)
            {
                return(new CommandResult(false, Messages.Account_NOT_FOUND, null));
            }

            await _SectorRepository.Delete(Sector);

            return(new CommandResult(
                       true,
                       Messages.DELETED_WITH_SUCCESS,
                       null));
        }
 public async Task <ActionResult <DeleteSectorCommandResponse> > Delete(DeleteSectorCommand request, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(await Send(request, cancellationToken));
 }