Beispiel #1
0
        public async Task <CheckLinksResponse> CheckLinksAsync(CheckLinksRequest request)
        {
            this.response    = new CheckLinksResponse();
            unprocessedLinks = new ConcurrentQueue <UnprocessedLink>();
            processedLinks   = new List <Uri>();

            if (request.Domain != null)
            {
                this.baseUri = request.Domain;
                this.unprocessedLinks.Enqueue(new UnprocessedLink
                {
                    PageUrl = request.Domain,
                    Link    = request.Domain
                });

                while (this.unprocessedLinks.Count > 0)
                {
                    this.response.Links.AddRange(await this.ProcessLinksAsync());
                }
            }
            else
            {
                this.response.Status = StatusCode.BadRequest;
            }

            return(this.response);
        }
Beispiel #2
0
		public async Task<CheckLinksResponse> CheckLinksAsync(CheckLinksRequest request)
		{
			this.response = new CheckLinksResponse();
			unprocessedLinks = new ConcurrentQueue<UnprocessedLink>();
			processedLinks = new List<Uri>();

			if (request.Domain != null)
			{
				this.baseUri = request.Domain;
				this.unprocessedLinks.Enqueue(new UnprocessedLink
				{
					PageUrl = request.Domain,
					Link = request.Domain
				});

				while (this.unprocessedLinks.Count > 0)
				{
					this.response.Links.AddRange(await this.ProcessLinksAsync());
				}
			}
			else
			{
				this.response.Status = StatusCode.BadRequest;
			}

			return this.response;
		}