public static T?GetService <T>(this ViewHandler handler) { var services = handler.GetServiceProvider(); var service = services.GetService <T>(); return(service); }
public static T?GetService <T>(this ViewHandler handler, Type type) { var services = handler.GetServiceProvider(); var service = services.GetService(type); return((T?)service); }
public static T GetRequiredService <T>(this ViewHandler handler) where T : notnull { var services = handler.GetServiceProvider(); var service = services.GetRequiredService <T>(); return(service); }