{"id":49,"date":"2015-09-10T20:47:38","date_gmt":"2015-09-10T20:47:38","guid":{"rendered":"http:\/\/vladymix.es\/?p=49"},"modified":"2015-09-10T20:47:38","modified_gmt":"2015-09-10T20:47:38","slug":"patron-singleton-en-c","status":"publish","type":"post","link":"https:\/\/vladymix.es\/wordpress\/index.php\/2015\/09\/10\/patron-singleton-en-c\/","title":{"rendered":"Patr\u00f3n Singleton en C#"},"content":{"rendered":"<p>Ejemplo de clase en <code> c#<\/code><\/p>\n<pre class=\"lang:c# decode:true \" title=\"Clase Singleton\">public class Singleton\r\n{\r\n   private static Singleton instance = null;\r\n \r\n   protected Singleton() {}\r\n \r\n   public static Singleton GetInstance\r\n   {\r\n     get\r\n     {\r\n        if (instance == null)\r\n           instance = new Singleton();\r\n \r\n        return instance;\r\n     }\r\n   }\r\n}<\/pre>\n<p>Para usar nuestro objeto singleton tenemos que llamar al m\u00e9todo GetInstance<\/p>\n<pre class=\"lang:c# decode:true\">var mySingleton = Singleton.GetInstance();<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ejemplo de clase en c# public class Singleton { private static Singleton instance = null; protected Singleton() {} public static&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[5],"class_list":["post-49","post","type-post","status-publish","format-standard","hentry","category-windows-store-and-phone","tag-patron-singleton"],"_links":{"self":[{"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=49"}],"version-history":[{"count":1,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/49\/revisions"}],"predecessor-version":[{"id":50,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/49\/revisions\/50"}],"wp:attachment":[{"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}