예제 #1
0
        /// <inheritdoc />
        ICollection<int> IDiscoverable<int>.Discover()
        {
            var request = new RecipeDiscoveryRequest();
            var response = this.serviceClient.Send<RecipeCollectionDataContract>(request);
            if (response.Content == null)
            {
                return new List<int>(0);
            }

            return this.converterForRecipeCollection.Convert(response.Content, null);
        }
예제 #2
0
 /// <inheritdoc />
 Task<ICollection<int>> IDiscoverable<int>.DiscoverAsync(CancellationToken cancellationToken)
 {
     var request = new RecipeDiscoveryRequest();
     var responseTask = this.serviceClient.SendAsync<RecipeCollectionDataContract>(request, cancellationToken);
     return responseTask.ContinueWith<ICollection<int>>(this.ConvertAsyncResponse, cancellationToken);
 }