Beispiel #1
0
        public static T?GetService <T>(this ViewHandler handler)
        {
            var services = handler.GetServiceProvider();

            var service = services.GetService <T>();

            return(service);
        }
Beispiel #2
0
        public static T?GetService <T>(this ViewHandler handler, Type type)
        {
            var services = handler.GetServiceProvider();

            var service = services.GetService(type);

            return((T?)service);
        }
Beispiel #3
0
        public static T GetRequiredService <T>(this ViewHandler handler)
            where T : notnull
        {
            var services = handler.GetServiceProvider();

            var service = services.GetRequiredService <T>();

            return(service);
        }