vendredi 11 septembre 2020

Singleton pattern in ASP.NET MVC

I`m new C# and ASP.NET and i need to understand how to create Singleton pattern, where to place the the class and how to access it when needed. Singleton class should create SMPP connections to each provider in Database and keep them in array(I think so), so when needed to use one of the connections the Singleton class should also have isConnected() method smth like checking the connection status for provider and if missing from array create new connection for provider passed as argument to the method. Is this a good way to implement such logic or there are better ways? Please help.

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire