示例#1
0
        /// <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);
        }
示例#2
0
 /// <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;
 }
示例#3
0
 /// <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;
 }