/// <summary> /// Creates the host in the persistent store. /// </summary> /// <returns></returns> public static bool CreateHost(ObjectRepository repository, string hostUserName, string hostPassword, string email) { if (_instance.Value != null) { throw new InvalidOperationException(Resources.InvalidOperation_HostRecordAlreadyExists); } var host = new HostInfo(ConfigurationManager.AppSettings) { HostUserName = hostUserName, Email = email }; SetHostPassword(host, hostPassword); return repository.UpdateHost(host); }
/// <summary> /// Updates the host in the persistent store. /// </summary> /// <param name="host">Host.</param> /// <returns></returns> public static bool UpdateHost(ObjectRepository repository, HostInfo host) { if (repository.UpdateHost(host)) { return true; } return false; }
/// <summary> /// Updates the host in the persistent store. /// </summary> /// <param name="host">Host.</param> /// <returns></returns> public static bool UpdateHost(ObjectRepository repository, HostInfo host) { if (repository.UpdateHost(host)) { _instance = new Lazy<HostInfo>(() => host); return true; } return false; }