Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <param name="httpContextAccessor">Http context.</param>
        /// <param name="configOptions">WebDAV Context configuration options.</param>
        /// <param name="logger">WebDAV Logger instance.</param>
        /// <param name="socketService">Singleton instance of <see cref="WebSocketsService"/>.</param>
        public DavContext(IHttpContextAccessor httpContextAccessor, IOptions <DavContextOptions> configOptions, ILogger logger
                          , WebSocketsService socketService
                          )
            : base(httpContextAccessor.HttpContext)
        {
            HttpContext httpContext = httpContextAccessor.HttpContext;

            if (httpContext.User != null)
            {
                Identity = httpContext.User.Identity;
            }
            RepositoryPath     = configOptions.Value.RepositoryPath;
            Logger             = logger;
            this.socketService = socketService;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes new instance of this class.
 /// </summary>
 /// <param name="next">Next middleware instance.</param>
 /// <param name="socketService">Singleton instance of <see cref="WebSocketsService"/>.</param>
 public WebSocketsMiddleware(RequestDelegate next, WebSocketsService socketService)
 {
     this.next          = next;
     this.socketService = socketService;
 }