private Stream CorrectView(string virtualPath, Stream stream) { if (_viewFixer == null) { return(stream); } var outStream = _viewFixer.CorrectView(virtualPath, stream); stream.Close(); return(outStream); }
/// <summary> /// Used to adjust the external views before they are returned。 /// </summary> /// <param name="virtualPath">Path to requested view。</param> /// <param name="fileStream">Loaded file。</param> /// <param name="webConfigStream">Stream that contain the web config。</param> /// <returns>Stream to use。</returns> protected virtual Stream CorrectView(string virtualPath, FileStream fileStream, FileStream webConfigStream) { IExternalViewFixer fixer = this.viewFixer ?? DependencyResolver.Current.GetService <IExternalViewFixer>(); if (fixer == null) { return(fileStream); } Stream fixedView = fixer.CorrectView(virtualPath, fileStream, webConfigStream); fileStream.Close(); return(fixedView); }