/// <inheritdoc /> public ViewEngineResult FindView(ActionContext context, string viewName, bool isMainPage) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (string.IsNullOrEmpty(viewName)) { throw new ArgumentException(Resources.ArgumentCannotBeNullOrEmpty, nameof(viewName)); } if (IsApplicationRelativePath(viewName) || IsRelativePath(viewName)) { // A path; not a name this method can handle. return ViewEngineResult.NotFound(viewName, Enumerable.Empty<string>()); } var cacheResult = LocatePageFromViewLocations(context, viewName, isMainPage); return CreateViewEngineResult(cacheResult, viewName); }
接着定位找到LocatePageFromViewLocations 方法: