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 }); }
public static string GetQueueName(this IQuidjiboCommand command) { var attr = command.GetType().GetTypeInfo().GetCustomAttribute <QueueNameAttribute>(); return(attr == null ? Default.Queue : attr.Name); }
public static string GetName(this IQuidjiboCommand command) { return(command.GetType().Name); }
public static string GetQualifiedName(this IQuidjiboCommand command) { return(command.GetType().AssemblyQualifiedName); }