You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Framework/Connected.Notifications/NotificationsStartup.cs

28 lines
780 B

2 years ago
using Connected.Annotations;
using Connected.Notifications.Events;
using Connected.Notifications.Events.Server;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
[assembly: MicroService(MicroServiceType.Sys)]
namespace Connected.Notifications;
internal class NotificationsStartup : Startup
{
public const string EventsHub = "/events";
protected override void OnConfigure(WebApplication app)
{
app.MapHub<EventHub>(EventsHub);
}
protected override void OnConfigureServices(IServiceCollection services)
{
services.AddSingleton(typeof(EventServer));
services.AddSingleton(typeof(EventServerConnection));
services.AddSingleton(typeof(IEventService), typeof(EventService));
services.AddTransient(typeof(EventDispatcher));
}
}