Beispiel #1
0
        public static Dictionary <string, bool> CheckDomains(string name, string[] extensions)
        {
            Guard.ArgumentNotNullOrWhiteSpace(name, "name");
            Guard.ArgumentNotNull(extensions, "extensions");

            Dictionary <string, bool> result = new Dictionary <string, bool>();

            extensions.Each(x => { result.AddOrUpdate(x, false); });

            IDomainProxy proxy     = XmlRpcProxyGen.Create <IDomainProxy>();
            XmlRpcStruct rpcResult = null;

            while (rpcResult == null || ShouldRevalidate(rpcResult))
            {
                rpcResult = proxy.Available(CloudConfigurationManager.GetSetting(Constants.ConfigurationKeys.GandiApiKey), GetDomains(name, extensions));
            }

            foreach (var key in rpcResult.Keys)
            {
                var skey      = key.ToString();
                var indexOf   = skey.IndexOf('.') + 1;
                var extension = skey.Substring(indexOf, skey.Length - indexOf);
                if (result.ContainsKey(extension))
                {
                    result[extension] = IsDomainStatusAvailable(rpcResult[key].ToString());
                }
            }

            return(result);
        }
Beispiel #2
0
		public static Task<long> Count<T>(this IDomainProxy repository)
			where T : class, ISearchable
		{
			if (repository == null)
				throw new ArgumentNullException("repository can't be null");
			return repository.Count<T>(null);
		}
 public ClientPersistableRepository(
     IDomainProxy domainProxy,
     IStandardProxy standardProxy)
     : base(domainProxy)
 {
     this.StandardProxy = standardProxy;
 }
Beispiel #4
0
		public static Task<T[]> Search<T>(
			this IDomainProxy repository,
			ISpecification<T> specification)
			where T : class, ISearchable
		{
			if (repository == null)
				throw new ArgumentNullException("repository can't be null");
			return repository.Search<T>(specification, null, null, null);
		}
Beispiel #5
0
		public static Task<T[]> FindAll<T>(
			this IDomainProxy repository,
			int? limit,
			int? offset)
			where T : class, ISearchable
		{
			if (repository == null)
				throw new ArgumentNullException("repository can't be null");
			return repository.Search<T>(null, limit, offset, null);
		}
Beispiel #6
0
 public ClientDomainStore(IDomainProxy domainProxy)
 {
     this.DomainProxy = domainProxy;
 }
Beispiel #7
0
 public ClientSearchableRepository(IDomainProxy domainProxy)
 {
     this.DomainProxy = domainProxy;
 }
Beispiel #8
0
 public ClientRepository(IDomainProxy domainProxy)
     : base(domainProxy)
 {
 }