Example #1
0
        public static void Register(IClassFactory factory)
        {
            factory.Register <IWebServer, OwinWebServer>();

            // A "do nothing" call that just makes sure that Microsoft.Owin.Host.HttpListener gets recognised by
            // the compiler and linker as a mandatory dependency of the project
            if (factory.GetType().IsAssignableFrom(typeof(Microsoft.Owin.Host.HttpListener.OwinHttpListener)))
            {
                throw new InvalidCastException("It will never get here but we need code that can't be optimised away");
            }
        }