{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/3973","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/3973/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/3973/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/3973/events","html_url":"https://github.com/aspnet/Mvc/issues/3973","id":128269062,"number":3973,"title":"[Discussion]: ViewComponent invocation changes","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,"assignees":[],"milestone":{"url":"https://api.github.com/repos/aspnet/Mvc/milestones/18","html_url":"https://github.com/aspnet/Mvc/milestones/Discussions","labels_url":"https://api.github.com/repos/aspnet/Mvc/milestones/18/labels","id":1254581,"number":18,"title":"Discussions","description":"","creator":{"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},"open_issues":34,"closed_issues":4,"state":"open","created_at":"2015-08-14T02:04:42Z","updated_at":"2016-07-01T17:54:02Z","due_on":null,"closed_at":null},"comments":28,"created_at":"2016-01-22T23:19:30Z","updated_at":"2016-07-04T08:50:10Z","closed_at":null,"body":"As part of https://github.com/aspnet/Mvc/issues/612, we simplified the behavior around selecting, and invoking ViewComponents.\r\n\r\n* To reduce ambiguity in ViewComponent method selection, we've modified the selection to only allow exactly one `Invoke` or `InvokeAsync` per `ViewComponent`.\r\n* `Component.Render`, `Component.RenderAsync` and `Component.Invoke` have been removed.\r\n* The signature of `Component.InvokeAsync` has been modified to accept a single argument that specifies the argument names and values used while calling `ViewComponent.Invoke` \\ `ViewComponent.InvokeAsync`.\r\ne.g.\r\n\r\n```C#\r\npublic class TestViewComponent : ViewComponent\r\n{\r\n    public IViewComponentResult Invoke(string name, int age)\r\n    {\r\n           ....\r\n    }\r\n}\r\n```\r\n\r\n### Before\r\n`@Component.InvokeAsync(\"Test\", \"MyName\", 15)`\r\n\r\n### After\r\n`@Component.InvokeAsync(\"Test\", new { name = \"MyName\", age = 15 })`\r\nor \r\n`@Component.InvokeAsync(\"Test\", new Dictionary<string, object> { [\"name\"] = \"MyName\", [\"age\"] = 15 })`\r\nor\r\n`@Component.InvokeAsync<TestViewComponent>(new { name = \"MyName\", age = 15})`"},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/230238856","html_url":"https://github.com/aspnet/Mvc/issues/3973#issuecomment-230238856","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/3973","id":230238856,"user":{"login":"psulek","id":2369743,"avatar_url":"https://avatars.githubusercontent.com/u/2369743?v=3","gravatar_id":"","url":"https://api.github.com/users/psulek","html_url":"https://github.com/psulek","followers_url":"https://api.github.com/users/psulek/followers","following_url":"https://api.github.com/users/psulek/following{/other_user}","gists_url":"https://api.github.com/users/psulek/gists{/gist_id}","starred_url":"https://api.github.com/users/psulek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psulek/subscriptions","organizations_url":"https://api.github.com/users/psulek/orgs","repos_url":"https://api.github.com/users/psulek/repos","events_url":"https://api.github.com/users/psulek/events{/privacy}","received_events_url":"https://api.github.com/users/psulek/received_events","type":"User","site_admin":false},"created_at":"2016-07-04T08:50:10Z","updated_at":"2016-07-04T08:50:10Z","body":"@andrew-vandenbrink Just hit problem you mentioned that i have passed my ViewModel directly into InvokeAsync and then in my view component (in Net Core 1.0 RTM) parameter is null !!"}}
{"actor":{"display_login":"psulek"}}