コード例 #1
0
        /// <inheritdoc />
        Recipe IRepository <int, Recipe> .Find(int identifier)
        {
            IRecipeRepository self = this;
            var request            = new RecipeDetailsRequest
            {
                Identifier = identifier.ToString(NumberFormatInfo.InvariantInfo),
                Culture    = self.Culture
            };
            var response = this.serviceClient.Send <RecipeDTO>(request);

            return(this.responseConverter.Convert(response, null));
        }
コード例 #2
0
        /// <inheritdoc />
        async Task <Recipe> IRepository <int, Recipe> .FindAsync(int identifier, CancellationToken cancellationToken)
        {
            IRecipeRepository self = this;
            var request            = new RecipeDetailsRequest
            {
                Identifier = identifier.ToString(NumberFormatInfo.InvariantInfo),
                Culture    = self.Culture
            };
            var response = await this.serviceClient.SendAsync <RecipeDTO>(request, cancellationToken).ConfigureAwait(false);

            return(this.responseConverter.Convert(response, null));
        }
コード例 #3
0
        /// <inheritdoc />
        Task <Recipe> IRepository <int, Recipe> .FindAsync(int identifier, CancellationToken cancellationToken)
        {
            IRecipeRepository self = this;
            var request            = new RecipeDetailsRequest
            {
                Identifier = identifier.ToString(NumberFormatInfo.InvariantInfo),
                Culture    = self.Culture
            };
            var responseTask = this.serviceClient.SendAsync <RecipeDataContract>(request, cancellationToken);

            return(responseTask.ContinueWith <Recipe>(this.ConvertAsyncResponse, cancellationToken));
        }