public static ICamundaWorkerBuilder AddHandler <T>(this ICamundaWorkerBuilder builder) where T : class, IExternalTaskHandler { Guard.NotNull(builder, nameof(builder)); var metadata = CollectMetadataFromAttributes(typeof(T)); return(builder.AddHandler <T>(metadata)); }
public static ICamundaWorkerBuilder AddHandler <T>(this ICamundaWorkerBuilder builder, HandlerMetadata metadata) where T : class, IExternalTaskHandler { Guard.NotNull(builder, nameof(builder)); Guard.NotNull(metadata, nameof(metadata)); var services = builder.Services; services.AddScoped <T>(); return(builder.AddHandler(HandlerDelegate <T>, metadata)); }