{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/5346","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/5346/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/5346/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/5346/events","html_url":"https://github.com/aspnet/Mvc/issues/5346","id":180455086,"number":5346,"title":"How would I go about getting the current router?","user":{"login":"atrauzzi","id":115199,"avatar_url":"https://avatars.githubusercontent.com/u/115199?v=3","gravatar_id":"","url":"https://api.github.com/users/atrauzzi","html_url":"https://github.com/atrauzzi","followers_url":"https://api.github.com/users/atrauzzi/followers","following_url":"https://api.github.com/users/atrauzzi/following{/other_user}","gists_url":"https://api.github.com/users/atrauzzi/gists{/gist_id}","starred_url":"https://api.github.com/users/atrauzzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atrauzzi/subscriptions","organizations_url":"https://api.github.com/users/atrauzzi/orgs","repos_url":"https://api.github.com/users/atrauzzi/repos","events_url":"https://api.github.com/users/atrauzzi/events{/privacy}","received_events_url":"https://api.github.com/users/atrauzzi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-01T12:52:35Z","updated_at":"2016-10-02T00:39:19Z","closed_at":null,"body":"I'm in a situation where I would like to be able to render templates for emails.  I'm using a class that instantiates a context and everything needed to run the razor engine.\r\n\r\nUnfortunately, this snippet just initializes an empty routing table rather than using the one from the current running application.\r\n\r\nIs there a safe way that I can obtain the current routing configuration to pass along to the templater?"},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/250946476","html_url":"https://github.com/aspnet/Mvc/issues/5346#issuecomment-250946476","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/5346","id":250946476,"user":{"login":"Eilon","id":202643,"avatar_url":"https://avatars.githubusercontent.com/u/202643?v=3","gravatar_id":"","url":"https://api.github.com/users/Eilon","html_url":"https://github.com/Eilon","followers_url":"https://api.github.com/users/Eilon/followers","following_url":"https://api.github.com/users/Eilon/following{/other_user}","gists_url":"https://api.github.com/users/Eilon/gists{/gist_id}","starred_url":"https://api.github.com/users/Eilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eilon/subscriptions","organizations_url":"https://api.github.com/users/Eilon/orgs","repos_url":"https://api.github.com/users/Eilon/repos","events_url":"https://api.github.com/users/Eilon/events{/privacy}","received_events_url":"https://api.github.com/users/Eilon/received_events","type":"User","site_admin":false},"created_at":"2016-10-02T00:39:19Z","updated_at":"2016-10-02T00:39:19Z","body":"What exactly do you mean by \"the current router\"? Is this within the context of an ASP.NET Core request that was handler by the routing middleware?\r\n\r\nI ask this because an application can have many routers - there can even be more than one that is \"current\" because a router can call another router!\r\n\r\nIf you have access to the current HttpContext for the request (assuming this is in the context of a request), you can get the [`IRoutingFeature`](https://github.com/aspnet/Routing/blob/dev/src/Microsoft.AspNetCore.Routing.Abstractions/IRoutingFeature.cs), and from that you can get the `RouteData`, and that has a collection of the current `IRouter`s for the request.u"}}
{"actor":{"display_login":"Eilon"}}