﻿namespace SignalR.Abstractions
{
    public static class HostContextExtensions
    {
        public static T GetValue<T>(this HostContext context, string key)
        {
            object value;
            if (context.Items.TryGetValue(key, out value))
            {
                return (T)value;
            }
            return default(T);
        }

        public static bool IsDebuggingEnabled(this HostContext context)
        {
            return context.GetValue<bool>("debugMode");
        }

        public static bool SupportsWebSockets(this HostContext context)
        {
            return context.GetValue<bool>("supportsWebSockets");
        }
    }
}

﻿namespace SignalR.Abstractions
{
    public static class HostContextExtensions
    {
        public static T GetValue<T>(this HostContext context, string key)
        {
            object value;
            if (context.Items.TryGetValue(key, out value))
            {
                return (T)value;
            }
            return default(T);
        }

        public static bool IsDebuggingEnabled(this HostContext context)
        {
            return context.GetValue<bool>(HostConstants.DebugMode);
        }

        public static bool SupportsWebSockets(this HostContext context)
        {
            return context.GetValue<bool>(HostConstants.SupportsWebSockets);
        }
    }
}

Use HostConstants in the extensions.
Use HostConstants in the extensions.
