{"action":"created","issue":{"url":"https://api.github.com/repos/Kentico/cloud-generators-net/issues/68","repository_url":"https://api.github.com/repos/Kentico/cloud-generators-net","labels_url":"https://api.github.com/repos/Kentico/cloud-generators-net/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/Kentico/cloud-generators-net/issues/68/comments","events_url":"https://api.github.com/repos/Kentico/cloud-generators-net/issues/68/events","html_url":"https://github.com/Kentico/cloud-generators-net/issues/68","id":333790598,"node_id":"MDU6SXNzdWUzMzM3OTA1OTg=","number":68,"title":"New Feature Request - Allow base types to be specified","user":{"login":"dconder","id":479488,"node_id":"MDQ6VXNlcjQ3OTQ4OA==","avatar_url":"https://avatars0.githubusercontent.com/u/479488?v=4","gravatar_id":"","url":"https://api.github.com/users/dconder","html_url":"https://github.com/dconder","followers_url":"https://api.github.com/users/dconder/followers","following_url":"https://api.github.com/users/dconder/following{/other_user}","gists_url":"https://api.github.com/users/dconder/gists{/gist_id}","starred_url":"https://api.github.com/users/dconder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dconder/subscriptions","organizations_url":"https://api.github.com/users/dconder/orgs","repos_url":"https://api.github.com/users/dconder/repos","events_url":"https://api.github.com/users/dconder/events{/privacy}","received_events_url":"https://api.github.com/users/dconder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-19T18:36:58Z","updated_at":"2018-06-20T09:11:32Z","closed_at":null,"author_association":"NONE","body":"In a fairly large implementation, with over 20 content types, it would be useful if all of the generated classes inherited from a common base type so we can add global members and have methods that have the base type as a parameter which could be used by all of the derived types. Also extension methods would be available. Would this be possible? I haven't looked at the code base, and I'd be willing to take a stab at this one if it is approved."},"comment":{"url":"https://api.github.com/repos/Kentico/cloud-generators-net/issues/comments/398680496","html_url":"https://github.com/Kentico/cloud-generators-net/issues/68#issuecomment-398680496","issue_url":"https://api.github.com/repos/Kentico/cloud-generators-net/issues/68","id":398680496,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODY4MDQ5Ng==","user":{"login":"petrsvihlik","id":9810625,"node_id":"MDQ6VXNlcjk4MTA2MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/9810625?v=4","gravatar_id":"","url":"https://api.github.com/users/petrsvihlik","html_url":"https://github.com/petrsvihlik","followers_url":"https://api.github.com/users/petrsvihlik/followers","following_url":"https://api.github.com/users/petrsvihlik/following{/other_user}","gists_url":"https://api.github.com/users/petrsvihlik/gists{/gist_id}","starred_url":"https://api.github.com/users/petrsvihlik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrsvihlik/subscriptions","organizations_url":"https://api.github.com/users/petrsvihlik/orgs","repos_url":"https://api.github.com/users/petrsvihlik/repos","events_url":"https://api.github.com/users/petrsvihlik/events{/privacy}","received_events_url":"https://api.github.com/users/petrsvihlik/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T09:11:31Z","updated_at":"2018-06-20T09:11:31Z","author_association":"MEMBER","body":"Hi @dconder ,\r\nit's actually by design that the generated classes don't inherit from a common base type. We wanted to keep the models POCO.\r\n\r\nWhat I would recommend in your case is extending the models using `partial` classes.\r\n\r\nSo in case of the [Dancing Goat site](https://github.com/Kentico/cloud-sample-app-net/tree/master/DancingGoat/Models/ContentTypes) it could look like this:\r\n\r\n\r\n**CommonBaseType.cs**\r\n```\r\npublic class CommonBaseType\r\n{\r\n... shared members\r\n}\r\n```\r\n\r\n**CommonBaseTypeExtender.cs**\r\n\r\n```\r\npublic partial class Article : CommonBaseType {}\r\npublic partial class Brewer : CommonBaseType {}\r\npublic partial class Cafe : CommonBaseType {}\r\npublic partial class Brewer : CommonBaseType {}\r\n```\r\n\r\nWould that work for you?"}}
{"actor":{"display_login":"petrsvihlik"}}