Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I just want to use a singleton design pattern in my asp.net MVC project, I don't know where and in which case is more suitable to used

can anyone give me 1 or 2 examples where I can used a singleton design pattern in my project with an example

What I have tried:

i searched a lot but i didn't find proper solution
Posted
Updated 15-Jul-22 21:49pm
Comments
Dave Kreskowiak 16-Jul-22 12:21pm    
Why does this question scream "homework assignment?"

1 solution

You are trying to work it the wrong way round. You need to examine your design to see where a singleton pattern might be useful, not try to fit the design to the pattern. See Singleton pattern - Wikipedia[^].
 
Share this answer
 
Comments
Akshay malvankar 16-Jul-22 4:01am    
I just want a example where i can used it
Richard MacCutchan 16-Jul-22 4:07am    
Then you need to use Google to find one; this site does not provide code to order.

There are examples in the Wikipedia link I gave you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900