public IFileInfo GetFileInfo(string subpath) { var viewPath = string.IsNullOrWhiteSpace(subpath) ? "/Views/FakeView.cshtml" : subpath; if (!Views.TryGetValue(viewPath, out var fileInfo)) { fileInfo = new ViewFileInfo(null); } return(fileInfo); }
public static void UpdateContent(string content, string view = null) { var viewPath = string.IsNullOrWhiteSpace(view) ? "/Views/FakeView.cshtml" : view; var old = Views[viewPath]; if (old.Content != content) { old.TokenSource.Cancel(); Views[viewPath] = new ViewFileInfo(content); } }