SignalR.DefaultPersistentConnectionFactory.CreateInstance C# (CSharp) Method

CreateInstance() public method

public CreateInstance ( System.Web.Routing.RequestContext requestContext, Type connectionType ) : PersistentConnection
requestContext System.Web.Routing.RequestContext
connectionType System.Type
return PersistentConnection
        public PersistentConnection CreateInstance(RequestContext requestContext, Type connectionType)
        {
            if (connectionType == null) {
                throw new ArgumentNullException("connectionType");
            }

            var connection = (DependencyResolver.Resolve(connectionType) ??
                              Activator.CreateInstance(connectionType)) as PersistentConnection;

            if (connection == null) {
                throw new InvalidOperationException(String.Format("'{0}' is not a {1}.", connectionType.FullName, typeof(PersistentConnection).FullName));
            }

            return connection;
        }
DefaultPersistentConnectionFactory