Last active
December 25, 2015 15:39
-
-
Save Fhernd/7000123 to your computer and use it in GitHub Desktop.
Demostración del uso de constructores estáticos en la implementación del patrón de diseño Singleton.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class ConexionBDSingleton | |
{ | |
private static ConexionBDSingleton conexion; | |
private ConexionBDSingleton() | |
{ | |
// sentencias de creación de la conexión a la BD. | |
} | |
static ConexionBDSingleton() | |
{ | |
conexion = ConexionBDSingleton(); | |
} | |
public static ConexionBDSingleton Conexion () | |
{ | |
get | |
{ | |
return conexion; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment