Should this C# code be refactored to use the Lazy<T> class instead?
I have the following code which could be called via multiple web-requests at the same second. As such, I don't want the second+ request hitting the database, but waiting until the first one does. Should I refactor this to use the Lazy<T> keyword class instead? If 10 calls to a Lazy<T> piece of code occur at the same time, do 9 of those calls wait for the first one to complete? public class ThemeService : IThemeService { private static readonly object SyncLock = new object(); private static IList<Theme> _themes; private readonly IRepository<Theme> _themeRepository; <snip snip snip> #region