{"id":318,"date":"2012-04-04T10:56:53","date_gmt":"2012-04-04T08:56:53","guid":{"rendered":"http:\/\/dev.flauschig.ch\/wordpress\/?p=318"},"modified":"2012-04-04T10:57:40","modified_gmt":"2012-04-04T08:57:40","slug":"318","status":"publish","type":"post","link":"http:\/\/dev.flauschig.ch\/wordpress\/?p=318","title":{"rendered":"add attributes on properties in a generated class"},"content":{"rendered":"<p>If you need to add attributes on properties in a generated class, you can do this by using following pattern.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n&#x5B;MetadataType(typeof(TimeFrame_Extension))]\r\npublic partial class TimeFrame { }\r\n\r\npublic class TimeFrame_Extension\r\n{\r\n    &#x5B;XmlIgnore]\r\n    public string From { get; set; }\r\n\r\n    &#x5B;XmlIgnore]\r\n    public string To { get; set; }\r\n}\r\n<\/pre>\n<p>source : <a href=\"http:\/\/ardalis.com\/adding-attributes-to-generated-classes\" title=\"http:\/\/ardalis.com\/adding-attributes-to-generated-classes\" target=\"_blank\">http:\/\/ardalis.com\/adding-attributes-to-generated-classes<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you need to add attributes on properties in a generated class, you can do this by using following pattern. &#x5B;MetadataType(typeof(TimeFrame_Extension))] public partial class TimeFrame { } public class TimeFrame_Extension { &#x5B;XmlIgnore] public string From { get; set; } &#x5B;XmlIgnore] public string To { get; set; } } source : http:\/\/ardalis.com\/adding-attributes-to-generated-classes<\/p>\n","protected":false},"author":370,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4,3],"tags":[],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-against","4":"post-318","6":"format-standard","7":"category-csharp","8":"category-programming"},"acf":[],"views":3378,"_links":{"self":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/318"}],"collection":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/370"}],"replies":[{"embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=318"}],"version-history":[{"count":0,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/318\/revisions"}],"wp:attachment":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}