public static IBranchBuilder UseBranch <TRequestHandler>(this IBranchBuilder builder, Predicate <object> predicate)
     where TRequestHandler : IRequestHandler
 {
     return(builder.UseBranch
            (
                predicate,
                branchBuilder => branchBuilder.UseHandler <TRequestHandler>()
            ));
 }
        public static IBranchBuilder UseCommand <TCommandHandler>(this IBranchBuilder builder)
            where TCommandHandler : ICommandHandler
        {
            var serviceProvider = builder.ServiceProvider;

            return(builder.UseBranch <TCommandHandler>
                   (
                       request => serviceProvider.GetRequiredService <TCommandHandler>()
                       .CanHandle(serviceProvider, request)
                   ));
        }