コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }