Problem : I’ve made a class that is a cross between a singleton (fifth version) and a (dependency injectable) factory. […]
Tag: singleton
Singleton or not
Problem : I have a windows service running.Inside this service I have hosted some service (WCF). I need to have […]
WCF Static Variable Getting Reset with Each Call
Problem : I have a WCF service that I am calling from multiple clients. I need to store and manage […]
Singleton pattern in web applications
Problem : I’m using a singleton pattern for the datacontext in my web application so that I dont have to […]
C# Singleton pattern with triggerable initialization
Problem : I need a singleton that: is lazy loaded is thread safe loads some values at construction those values […]
Singleton by Jon Skeet clarification
Problem : public sealed class Singleton { Singleton() {} public static Singleton Instance { get { return Nested.instance; } } […]
What is a singleton in C#?
Problem : What is a Singleton and when should I use it? Solution : A singleton is a class which […]
Is it a good practice to have logger as a singleton?
Problem : I had a habit to pass logger to constructor, like: public class OrderService : IOrderService { public OrderService(ILogger […]
What’s the difference in these ways of creating the static instance for a singleton?
Problem : I have had a bug recently that only manifested itself when the library was built as a release […]
An obvious singleton implementation for .NET?
Problem : I was thinking about the classic issue of lazy singleton initialization – the whole matter of the inefficiency […]