Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

丁松杰 / Pole

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • Pole
  • src
  • Pole.Application
  • Command
  • Internal
  • DefaultCommandBus.cs
Find file
BlameHistoryPermalink
  • dingsongjie's avatar
    完成 unitofwork 部分改造 · 5495256f
    dingsongjie committed 5 years ago
    5495256f
DefaultCommandBus.cs 804 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using MediatR;
using Pole.Application.Command;

namespace Pole.Application.Cqrs.Internal
{
    class DefaultCommandBus : ICommandBus
    {
        private readonly IMediator _mediator;
        public DefaultCommandBus(IMediator mediator)
        {
            _mediator = mediator;
        }
        public Task<TResult> Send<TResult>(IRequest<TResult> request, CancellationToken cancellationToken = default)
        {
            return _mediator.Send(request, cancellationToken);
        }

        public Task<object> Send(object request, CancellationToken cancellationToken = default)
        {
            return _mediator.Send(request, cancellationToken);
        }
    }
}