public static ContextLoader CreateContextLoader <T>() { var contextType = typeof(T); // Check a context class is marked with the [Context] attribute. AttributeHelper.CheckHasTypeAttribute <Context.Attributes.Context, NotLoadableContextException>(contextType); // Check a context class is instantiable ReflectionHelper.CheckInstantiableClass(contextType); return(new ContextLoader(contextType)); }