{"id":6551,"date":"2018-12-09T13:41:50","date_gmt":"2018-12-09T13:41:50","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=6551"},"modified":"2018-12-09T13:41:50","modified_gmt":"2018-12-09T13:41:50","slug":"singletons-using-c-6-syntax","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/singletons-using-c-6-syntax\/","title":{"rendered":"Singletons using C# 6 syntax"},"content":{"rendered":"<p>A while back I wrote the post <a href=\"http:\/\/putridparrot.com\/blog\/singleton-in-c\/\" rel=\"noopener\" target=\"_blank\">The Singleton Pattern in C#<\/a> and just thought it&#8217;d be nice to use C# 6 syntax to update this post.<\/p>\n<p>So here&#8217;s the code with the change for to use default property syntax<\/p>\n<p>public sealed class Singleton<br \/>\n{<br \/>\n    public static Singleton Instance { get; } = new Singleton();<\/p>\n<p>    static Singleton() { }<br \/>\n    private Singleton() { }<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A while back I wrote the post The Singleton Pattern in C# and just thought it&#8217;d be nice to use C# 6 syntax to update this post. So here&#8217;s the code with the change for to use default property syntax public sealed class Singleton { public static Singleton Instance { get; } = new Singleton(); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-6551","post","type-post","status-publish","format-standard","hentry","category-c"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/6551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=6551"}],"version-history":[{"count":2,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/6551\/revisions"}],"predecessor-version":[{"id":6594,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/6551\/revisions\/6594"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=6551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=6551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=6551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}