{"id":72,"date":"2019-09-15T05:50:49","date_gmt":"2019-09-15T05:50:49","guid":{"rendered":"http:\/\/sumitjangid.com\/?p=72"},"modified":"2019-09-15T05:50:49","modified_gmt":"2019-09-15T05:50:49","slug":"creating-meta-classes-for-meta-data","status":"publish","type":"post","link":"http:\/\/sumitjangid.com\/index.php\/2019\/09\/15\/creating-meta-classes-for-meta-data\/","title":{"rendered":"Creating Meta Classes for Meta Data"},"content":{"rendered":"\n<p>you can create new meta classes for meta data like display name, required or not, etc.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public partial class activitymeta  \/\/Meta class created to set the meta properties\n    {\n        [Display(Name =\"Activity ID\")]\n        public int id { get; set; }\n        [Display(Name = \"Activity Time\")]\n        public System.DateTime activitytime { get; set; }\n        [Display(Name = \"Activity Type\")]\n        public string type { get; set; }\n        [Display(Name = \"Activity User\")]\n        public string activityuser { get; set; }\n        [Display(Name = \"Activity Message\")]\n        public string message { get; set; }\n    }\n[MetadataType(typeof(user_rolemeta))]    \/\/Assigning the meta class to the actual class\n    public partial class activity { } \/\/Actual class in your project<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>you can create new meta classes for meta data like display name, required or not, etc.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,5,2],"tags":[],"_links":{"self":[{"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/posts\/72"}],"collection":[{"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":1,"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":73,"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/posts\/72\/revisions\/73"}],"wp:attachment":[{"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}