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); } }
public object CreateInstance(string virtualPath) => Activator.CreateInstance(_viewEngine.GetTypeFromVirtualPath(virtualPath));