public NotificationController(DataContext context,
                               IMapper mapper,
                               IHttpContextAccessor httpContextAccessor,
                               ILogger <NotificationController> logger,
                               SseService sseService,
                               NotificationService notificationService)
 {
     _context             = context;
     _mapper              = mapper;
     _httpContextAccessor = httpContextAccessor;
     _logger              = logger;
     _sseService          = sseService;
     _notificationService = notificationService;
 }
Example #2
0
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env,
                              SseService sseService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseSwagger();
                app.UseSwaggerUI(c =>
                                 c.SwaggerEndpoint("/swagger/v1/swagger.json", "SSEServer v1"));
            }

            sseService.CreateMethodsMap(Assembly.GetExecutingAssembly());

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();
            app.UseAuthentication();
            app.UseCors("CorsPolicy");
            app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
        }
Example #3
0
 public static async Task Create(this SseService service, HttpContext context,
                                 params (string n, string v)[] props)
Example #4
0
 public SseMiddleWare(RequestDelegate next, SseService sseService)
 {
     _sseService = sseService;
     _next       = next;
 }