Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created June 17, 2020 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcomartin/2fb23a5a778e9987470ed14e1c2d0a31 to your computer and use it in GitHub Desktop.
Save dcomartin/2fb23a5a778e9987470ed14e1c2d0a31 to your computer and use it in GitHub Desktop.
using DotNetCore.CAP;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace CAPDemo
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddTransient<HelloWorldReceiver>();
services.AddCap(options =>
{
options.UseMySql("Server=localhost;Uid=root;Pwd=root;Database=Demo");
options.UseRabbitMQ("localhost");
options.UseDashboard();
});
services.AddControllersWithViews();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseDeveloperExceptionPage();
app.UseCapDashboard();
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment