{"action":"created","issue":{"url":"https://api.github.com/repos/NancyFx/Nancy/issues/2573","repository_url":"https://api.github.com/repos/NancyFx/Nancy","labels_url":"https://api.github.com/repos/NancyFx/Nancy/issues/2573/labels{/name}","comments_url":"https://api.github.com/repos/NancyFx/Nancy/issues/2573/comments","events_url":"https://api.github.com/repos/NancyFx/Nancy/issues/2573/events","html_url":"https://github.com/NancyFx/Nancy/pull/2573","id":179120796,"number":2573,"title":"[WIP] ASP.NET Core Razor engine - do not merge","user":{"login":"daveaglick","id":1020407,"avatar_url":"https://avatars.githubusercontent.com/u/1020407?v=3","gravatar_id":"","url":"https://api.github.com/users/daveaglick","html_url":"https://github.com/daveaglick","followers_url":"https://api.github.com/users/daveaglick/followers","following_url":"https://api.github.com/users/daveaglick/following{/other_user}","gists_url":"https://api.github.com/users/daveaglick/gists{/gist_id}","starred_url":"https://api.github.com/users/daveaglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveaglick/subscriptions","organizations_url":"https://api.github.com/users/daveaglick/orgs","repos_url":"https://api.github.com/users/daveaglick/repos","events_url":"https://api.github.com/users/daveaglick/events{/privacy}","received_events_url":"https://api.github.com/users/daveaglick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-09-26T01:07:52Z","updated_at":"2016-10-04T20:29:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/NancyFx/Nancy/pulls/2573","html_url":"https://github.com/NancyFx/Nancy/pull/2573","diff_url":"https://github.com/NancyFx/Nancy/pull/2573.diff","patch_url":"https://github.com/NancyFx/Nancy/pull/2573.patch"},"body":"**DO NOT MERGE**\r\n\r\nRelates to #2521. This is an initial cut at getting the Razor engine in .NET Core working on Nancy. There's still quite a bit left to do, but I wanted to get any early feedback you might have given the scale of changes and the importance of Razor parsing in Nancy.\r\n\r\nSome notes:\r\n- **Host**: I used the full ASP.NET Core MVC Razor host instead of trying to build up a new one from scratch as the current Nancy Razor view engine does. There are examples of lightweight Razor Core hosts (see https://github.com/aspnet/Entropy/tree/dev/samples/Mvc.RenderViewToString), but using the full MVC host should provide the most compatibility and allows Nancy to use many of the same abstractions that full ASP.NET MVC does.\r\n- **DI**: I am creating an independent container within the Nancy Razor view engine to handle services. We *could* register all the Razor/MVC services with TinyIoC, but we'd have to provide an `IServiceProvider` implementation for TinyIoC that the Razor host can consume. This seemed easier, at least for now.\r\n- **Assembly Loading**: I am currently loading *all* runtime assemblies into the Razor compilation context. There are so many required assemblies in the new version of Razor that attempting to enumerate them all by hand for loading was going to be tough. This can be revisited in the future if we need to.\r\n- I removed the `Nancy.ViewEngines.Razor.BuildProviders` project. I'm not sure what it was for? Will we need it for the new implementation? [Update: don't think we'll need this - since we're using the full MVC host this time around, the VS Intellisense should do a good job with the views given they're derived from the same class]\r\n\r\nStill to do:\r\n- [ ] Antiforgery token support\r\n- [x] Verify view location finding in a variety of cases\r\n- [x] Error page support\r\n- [x] Re-enable and port (if needed) the test projects\r\n- [ ] Integrate Razor and Nancy logging\r\n- [ ] Provide wrappers around Nancy context for ASP.NET MVC core classes (like `HttpContext`)\r\n- [ ] Add Nancy context classes to the base Razor page\r\n- [ ] XML code documentation\r\n- [ ] Update the Nancy Wiki\r\n- [x] Build housekeeping (what are the `*.MSBuild` projects? currently targeting `netstandard 1.6`, does it need to be multitarget?)\r\n\r\nAnyway, I'll continue working on this and pushing to the PR branch. I'd welcome any comments, suggestions, direction if/when anyone gets a chance to look at it. Also, I've turned on edits from maintainers, feel free to push some code!"},"comment":{"url":"https://api.github.com/repos/NancyFx/Nancy/issues/comments/251503556","html_url":"https://github.com/NancyFx/Nancy/pull/2573#issuecomment-251503556","issue_url":"https://api.github.com/repos/NancyFx/Nancy/issues/2573","id":251503556,"user":{"login":"mylemans","id":749261,"avatar_url":"https://avatars.githubusercontent.com/u/749261?v=3","gravatar_id":"","url":"https://api.github.com/users/mylemans","html_url":"https://github.com/mylemans","followers_url":"https://api.github.com/users/mylemans/followers","following_url":"https://api.github.com/users/mylemans/following{/other_user}","gists_url":"https://api.github.com/users/mylemans/gists{/gist_id}","starred_url":"https://api.github.com/users/mylemans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mylemans/subscriptions","organizations_url":"https://api.github.com/users/mylemans/orgs","repos_url":"https://api.github.com/users/mylemans/repos","events_url":"https://api.github.com/users/mylemans/events{/privacy}","received_events_url":"https://api.github.com/users/mylemans/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T20:29:25Z","updated_at":"2016-10-04T20:29:25Z","body":"Any chance of getting a 'working hello world' example that showcases this? :)"}}
{"actor":{"display_login":"mylemans"}}