{"action":"created","issue":{"url":"https://api.github.com/repos/OData/odata.net/issues/676","repository_url":"https://api.github.com/repos/OData/odata.net","labels_url":"https://api.github.com/repos/OData/odata.net/issues/676/labels{/name}","comments_url":"https://api.github.com/repos/OData/odata.net/issues/676/comments","events_url":"https://api.github.com/repos/OData/odata.net/issues/676/events","html_url":"https://github.com/OData/odata.net/issues/676","id":170617431,"number":676,"title":"Select property from inherited type - Exception: Could not find a property named 'X' on type 'T'","user":{"login":"FordSoft","id":2373228,"avatar_url":"https://avatars.githubusercontent.com/u/2373228?v=3","gravatar_id":"","url":"https://api.github.com/users/FordSoft","html_url":"https://github.com/FordSoft","followers_url":"https://api.github.com/users/FordSoft/followers","following_url":"https://api.github.com/users/FordSoft/following{/other_user}","gists_url":"https://api.github.com/users/FordSoft/gists{/gist_id}","starred_url":"https://api.github.com/users/FordSoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FordSoft/subscriptions","organizations_url":"https://api.github.com/users/FordSoft/orgs","repos_url":"https://api.github.com/users/FordSoft/repos","events_url":"https://api.github.com/users/FordSoft/events{/privacy}","received_events_url":"https://api.github.com/users/FordSoft/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-11T10:46:24Z","updated_at":"2016-08-12T02:23:28Z","closed_at":null,"body":"I have this domain model:\r\n\r\n```\r\npublic class Parent \r\n{  \r\n   public string Prop1 {get;set;}\r\n}\r\n\r\npublic class Child : Parent\r\n{\r\n   public string Prop2 {get;set;}\r\n}\r\n\r\npublic class Container\r\n{\r\n  Parent Dummy {get;set;}\r\n}\r\n\r\nvar instance = new Container()\r\n{\r\n  Dummy = new Container()\r\n  {\r\n    Prop1 = \"BLA BLA\"\r\n  }\r\n}\r\n```\r\nwhen I call this:\r\n\r\n`/api/Container(1)?$expand=Dummy($select=Prop1)`\r\nit's ok.\r\n\r\nwhen I call this:\r\n\r\n`/api/Container(1)?$expand=Dummy($select=Prop2)`\r\nI get exception:\r\n\r\nCould not find a property named 'Prop2' on type 'Parent'.\r\nhow do I get the property 'Prop2' ?"},"comment":{"url":"https://api.github.com/repos/OData/odata.net/issues/comments/239346624","html_url":"https://github.com/OData/odata.net/issues/676#issuecomment-239346624","issue_url":"https://api.github.com/repos/OData/odata.net/issues/676","id":239346624,"user":{"login":"Lingxi-Li","id":11997203,"avatar_url":"https://avatars.githubusercontent.com/u/11997203?v=3","gravatar_id":"","url":"https://api.github.com/users/Lingxi-Li","html_url":"https://github.com/Lingxi-Li","followers_url":"https://api.github.com/users/Lingxi-Li/followers","following_url":"https://api.github.com/users/Lingxi-Li/following{/other_user}","gists_url":"https://api.github.com/users/Lingxi-Li/gists{/gist_id}","starred_url":"https://api.github.com/users/Lingxi-Li/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lingxi-Li/subscriptions","organizations_url":"https://api.github.com/users/Lingxi-Li/orgs","repos_url":"https://api.github.com/users/Lingxi-Li/repos","events_url":"https://api.github.com/users/Lingxi-Li/events{/privacy}","received_events_url":"https://api.github.com/users/Lingxi-Li/received_events","type":"User","site_admin":false},"created_at":"2016-08-12T02:23:28Z","updated_at":"2016-08-12T02:23:28Z","body":"Please provide a [MCVE](http://stackoverflow.com/help/mcve). From the code you have provided, I have seen the following issues:\r\n\r\n1. `Container` does not inherit from `Parent`. So how could you initialize the `Dummy` property (which is of type `Parent`) with a `Container` instance?\r\n\r\n2. Likewise, `Container` does not have a property named `Prop1`.\r\n"}}
{"actor":{"display_login":"Lingxi-Li"}}