예제 #1
0
 public object CreateInstance(string virtualPath)
 {
     if (_precompiled?.TryLookupCompiledType(virtualPath) is Type precompiledType)
     {
         return(Activator.CreateInstance(precompiledType));
     }
     else if (_runtime?.GetTypeFromVirtualPath(virtualPath) is Type runtimeType)
     {
         return(Activator.CreateInstance(runtimeType));
     }
     else
     {
         return(null);
     }
 }
예제 #2
0
 public object CreateInstance(string virtualPath) =>
 Activator.CreateInstance(_viewEngine.GetTypeFromVirtualPath(virtualPath));