{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/3030","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/3030/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/3030/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/3030/events","html_url":"https://github.com/aspnet/Mvc/issues/3030","id":102893360,"number":3030,"title":"Refactor IRazorPage to write output to a IHtmlContent instead of TextWriter","user":{"login":"pranavkm","id":174281,"avatar_url":"https://avatars.githubusercontent.com/u/174281?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavkm","html_url":"https://github.com/pranavkm","followers_url":"https://api.github.com/users/pranavkm/followers","following_url":"https://api.github.com/users/pranavkm/following{/other_user}","gists_url":"https://api.github.com/users/pranavkm/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavkm/subscriptions","organizations_url":"https://api.github.com/users/pranavkm/orgs","repos_url":"https://api.github.com/users/pranavkm/repos","events_url":"https://api.github.com/users/pranavkm/events{/privacy}","received_events_url":"https://api.github.com/users/pranavkm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-24T21:15:45Z","updated_at":"2015-08-24T21:58:34Z","closed_at":null,"body":"The interface contract for a `IRazorPage` \\ `RazorPage` is to write to the `TextWriter` instance exposed via `ViewContext.Writer`. In the default case (i.e. the user isn't using a custom `IRazorView`), `ViewContext.Writer` is an instance of `RazorTextWriter` which essentially has the same sort of contract \\ behavior as `IHtmlContent`.\r\n\r\nWe could instead change `IRazorPage` to expose its results as an `IHtmlContent` instead. This change would allow us\r\n\r\na) We can follow the same append pattern we get with appending one `IHtmlContent` to another used through the remainder of the application.\r\n\r\nb) Remove the contract that we give special treatment to `TextWriter` instances that implement `IBufferedTextWriter`. Also remove `IBufferedTextWriter`.\r\n\r\nRelated discussion: Since page instrumentation \\ BrowserLink will be affected by this interface change, we can follow up with @jodavis to figure out if they can rely on EventNotification instead our current interface based contract.\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/134392479","html_url":"https://github.com/aspnet/Mvc/issues/3030#issuecomment-134392479","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/3030","id":134392479,"user":{"login":"pranavkm","id":174281,"avatar_url":"https://avatars.githubusercontent.com/u/174281?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavkm","html_url":"https://github.com/pranavkm","followers_url":"https://api.github.com/users/pranavkm/followers","following_url":"https://api.github.com/users/pranavkm/following{/other_user}","gists_url":"https://api.github.com/users/pranavkm/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavkm/subscriptions","organizations_url":"https://api.github.com/users/pranavkm/orgs","repos_url":"https://api.github.com/users/pranavkm/repos","events_url":"https://api.github.com/users/pranavkm/events{/privacy}","received_events_url":"https://api.github.com/users/pranavkm/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T21:58:34Z","updated_at":"2015-08-24T21:58:34Z","body":"`RazorPage` does not write out content - the view does. Its behavior is identical to any other component in the Razor rendering pipeline."}}