Nelze vybrat více než 25 témat
Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
|
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using Microsoft.AspNetCore.Builder;
- using Microsoft.AspNetCore.Hosting;
- using Microsoft.Extensions.DependencyInjection;
-
- namespace Sample.RabbitMQ.PostgreSql
- {
- public class Startup
- {
- // This method gets called by the runtime. Use this method to add services to the container.
- public void ConfigureServices(IServiceCollection services)
- {
- services.AddDbContext<AppDbContext>();
- services.AddCap(x =>
- {
- x.UseEntityFramework<AppDbContext>();
- x.UseRabbitMQ("localhost");
- x.UseDashboard();
- x.UseDiscovery(d =>
- {
- d.DiscoveryServerHostName = "localhost";
- d.DiscoveryServerPort = 8500;
- d.CurrentNodeHostName = "localhost";
- d.CurrentNodePort = 5800;
- d.NodeName = "CAP 一号节点";
- });
- });
- services.AddMvc();
- }
-
- // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
- public void Configure(IApplicationBuilder app, IHostingEnvironment env)
- {
- app.UseMvc();
-
- app.UseCap();
- }
- }
- }
|