-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathStartup.cs
More file actions
26 lines (23 loc) · 964 Bytes
/
Startup.cs
File metadata and controls
26 lines (23 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using MetricsExample.DifferentNamespace;
using MetricsExample.Model;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Motor.Extensions.Diagnostics.Queue.Metrics;
using Motor.Extensions.Hosting.Abstractions;
using Motor.Extensions.Utilities.Abstractions;
namespace MetricsExample;
public class Startup : IMotorStartup
{
public void ConfigureServices(WebHostBuilderContext context, IServiceCollection services)
{
// Add a handler for the input message which returns an output message
// This handler is called for every new incoming message
services.AddTransient<INoOutputService<InputMessage>, ServiceWithMetrics>();
services.AddTransient<IServiceInDifferentNamespace, ServiceInDifferentNamespace>();
}
public void Configure(WebHostBuilderContext context, IApplicationBuilder builder)
{
builder.UseQueueMonitoring();
}
}