using System.Collections.Generic; using System.Linq; namespace Oqtane.Infrastructure { // singleton public class ServerStateManager : IServerStateManager { private List _serverStates { get; set; } public ServerStateManager() { _serverStates = new List(); } public ServerState GetServerState(string siteKey) { var serverState = _serverStates.FirstOrDefault(item => item.SiteKey == siteKey); if (serverState == null) { serverState = new ServerState(); serverState.SiteKey = siteKey; serverState.Assemblies = new List(); serverState.IsInitialized = false; _serverStates.Add(serverState); } return serverState; } } }