{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/5380","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/5380/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/5380/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/5380/events","html_url":"https://github.com/aspnet/Mvc/issues/5380","id":181598757,"number":5380,"title":"Update error for \"generic ViewComponents\" to explain what a valid view component is","user":{"login":"NTaylorMullen","id":2008729,"avatar_url":"https://avatars.githubusercontent.com/u/2008729?v=3","gravatar_id":"","url":"https://api.github.com/users/NTaylorMullen","html_url":"https://github.com/NTaylorMullen","followers_url":"https://api.github.com/users/NTaylorMullen/followers","following_url":"https://api.github.com/users/NTaylorMullen/following{/other_user}","gists_url":"https://api.github.com/users/NTaylorMullen/gists{/gist_id}","starred_url":"https://api.github.com/users/NTaylorMullen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NTaylorMullen/subscriptions","organizations_url":"https://api.github.com/users/NTaylorMullen/orgs","repos_url":"https://api.github.com/users/NTaylorMullen/repos","events_url":"https://api.github.com/users/NTaylorMullen/events{/privacy}","received_events_url":"https://api.github.com/users/NTaylorMullen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/Mvc/labels/1%20-%20Ready","name":"1 - Ready","color":"CCCCCC"},{"url":"https://api.github.com/repos/aspnet/Mvc/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/aspnet/Mvc/labels/up-for-grabs","name":"up-for-grabs","color":"207de5"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/aspnet/Mvc/milestones/27","html_url":"https://github.com/aspnet/Mvc/milestones/1.1.0","labels_url":"https://api.github.com/repos/aspnet/Mvc/milestones/27/labels","id":2038285,"number":27,"title":"1.1.0","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":36,"closed_issues":1,"state":"open","created_at":"2016-09-29T17:42:41Z","updated_at":"2016-10-10T18:03:08Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-10-07T07:06:14Z","updated_at":"2016-10-11T13:37:20Z","closed_at":null,"body":"Given the following example:\r\n\r\n```C#\r\npublic class FooViewComponent<T>\r\n{\r\n    public string Invoke(T value)\r\n    {\r\n        return value.ToString();\r\n    }\r\n}\r\n```\r\n\r\nTrying to run this like so:\r\n```\r\n@{\r\n    Write(await Component.InvokeAsync<FooViewComponent<string>>(new\r\n    {\r\n        value = \"Hello World\"\r\n    }));\r\n}\r\n```\r\n\r\nResults in the following:\r\n![image](https://cloud.githubusercontent.com/assets/2008729/19181421/d1ba52ea-8c21-11e6-9803-3cb00ebf9003.png)\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/252918605","html_url":"https://github.com/aspnet/Mvc/issues/5380#issuecomment-252918605","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/5380","id":252918605,"user":{"login":"iscifoni","id":19547005,"avatar_url":"https://avatars.githubusercontent.com/u/19547005?v=3","gravatar_id":"","url":"https://api.github.com/users/iscifoni","html_url":"https://github.com/iscifoni","followers_url":"https://api.github.com/users/iscifoni/followers","following_url":"https://api.github.com/users/iscifoni/following{/other_user}","gists_url":"https://api.github.com/users/iscifoni/gists{/gist_id}","starred_url":"https://api.github.com/users/iscifoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iscifoni/subscriptions","organizations_url":"https://api.github.com/users/iscifoni/orgs","repos_url":"https://api.github.com/users/iscifoni/repos","events_url":"https://api.github.com/users/iscifoni/events{/privacy}","received_events_url":"https://api.github.com/users/iscifoni/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T13:37:20Z","updated_at":"2016-10-11T13:37:20Z","body":"Hi,\r\n\r\nfrom the code ( https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.ViewFeatures/ViewComponents/ViewComponentConventions.cs#L76 ), I think the rules is :\r\n\r\n- is class\r\n- is public \r\n- not is abstract\r\n- not contains generic parameter\r\n- not is defined NonViewComponentAttribute\r\n- is defined ViewComponentAttribute\r\n- class name end with \"ViewComponent\"\r\n\r\nSo the message could be :\r\n\r\n\"A view component named '<type>' could not be found. View components must be a Public non-generic concrete type, not contains generic parameters, use ViewComponentAttribute or class name end with 'ViewComponent' \"."}}
{"actor":{"display_login":"iscifoni"}}