Esempio n. 1
0
		public void HandleResponses(GetResponse[] responses, ShardStrategy shardStrategy)
		{
			var result = new SuggestionQueryResult
			{
				Suggestions = responses
					.Select(item => RavenJObject.Parse(item.Result))
					.SelectMany(data => ((RavenJArray) data["Suggestions"]).Select(x => x.Value<string>()))
					.Distinct()
					.ToArray()
			};

			Result = result;
		}
		public void HandleResponses(GetResponse[] responses, ShardStrategy shardStrategy)
		{
			var result = new SuggestionQueryResult
			{
				Suggestions = (from item in responses
							   let data = (RavenJObject)item.Result
							   from suggestion in (RavenJArray)data["Suggestions"]
							   select suggestion.Value<string>())
							  .Distinct()
							  .ToArray()
			};

			Result = result;
		}
		public void HandleResponse(GetResponse response)
		{
			if (response.Status != 200 && response.Status != 304)
			{
				throw new InvalidOperationException("Got an unexpected response code for the request: " + response.Status + "\r\n" +
													response.Result);
			}

			var result = (RavenJObject)response.Result;
			Result = new SuggestionQueryResult
			{
				Suggestions = ((RavenJArray)result["Suggestions"]).Select(x => x.Value<string>()).ToArray(),
			};
		}
Esempio n. 4
0
 public IndexModel()
 {
     Authors = new StaticPagedList<AuthorWithCount>(new List<AuthorWithCount>(), 1, 25, 0);
     Suggestions = new SuggestionQueryResult();
 }
Esempio n. 5
0
 public IndexModel()
 {
     Quotes = new PagedList<Quote>(new List<Quote>(), 1, 25);
     Suggestions = new SuggestionQueryResult();
 }
Esempio n. 6
0
 public IndexModel()
 {
     Categories = new StaticPagedList<CategoryWithCount>(new List<CategoryWithCount>(), 1, 25, 0);
     Suggestions = new SuggestionQueryResult();
 }