Beispiel #1
0
        public async Task DispatchAsync(IQuidjiboCommand command, IQuidjiboProgress progress, CancellationToken cancellationToken)
        {
            var type     = typeof(IQuidjiboHandler <>).MakeGenericType(command.GetType());
            var resolved = _resolver.Resolve(type);
            var method   = type.GetMethod("ProcessAsync");

            await(Task) method.Invoke(resolved, new object[]
            {
                command,
                progress,
                cancellationToken
            });
        }
Beispiel #2
0
        public static string GetQueueName(this IQuidjiboCommand command)
        {
            var attr = command.GetType().GetTypeInfo().GetCustomAttribute <QueueNameAttribute>();

            return(attr == null ? Default.Queue : attr.Name);
        }
Beispiel #3
0
 public static string GetName(this IQuidjiboCommand command)
 {
     return(command.GetType().Name);
 }
Beispiel #4
0
 public static string GetQualifiedName(this IQuidjiboCommand command)
 {
     return(command.GetType().AssemblyQualifiedName);
 }