コード例 #1
0
        public static IMvcBuilder AddNetCleanDapr(this IMvcBuilder builder)
        {
            // Controller with custom validator
            var mvcBuilder = builder.AddDapr();

            return(mvcBuilder);
        }
コード例 #2
0
        public static IServiceCollection AddMessageBroker(this IMvcBuilder mvcBuilder,
                                                          IConfiguration config,
                                                          string messageBrokerType = "dapr")
        {
            switch (messageBrokerType)
            {
            case "dapr":
                mvcBuilder.Services.Configure <DaprEventBusOptions>(config.GetSection(DaprEventBusOptions.Name));
                mvcBuilder.AddDapr();
                mvcBuilder.Services.AddScoped <IEventBus, DaprEventBus>();
                break;
            }

            return(mvcBuilder.Services);
        }