Ejemplo n.º 1
0
        /// <inheritdoc />
        Item IRepository <int, Item> .Find(int identifier)
        {
            IItemRepository self    = this;
            var             request = new ItemDetailsRequest
            {
                Identifier = identifier.ToString(NumberFormatInfo.InvariantInfo),
                Culture    = self.Culture
            };
            var response = this.serviceClient.Send <ItemDTO>(request);

            return(this.responseConverter.Convert(response, null));
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        async Task <Item> IRepository <int, Item> .FindAsync(int identifier, CancellationToken cancellationToken)
        {
            IItemRepository self    = this;
            var             request = new ItemDetailsRequest
            {
                Identifier = identifier.ToString(NumberFormatInfo.InvariantInfo),
                Culture    = self.Culture
            };
            var response = await this.serviceClient.SendAsync <ItemDTO>(request, cancellationToken).ConfigureAwait(false);

            return(this.responseConverter.Convert(response, null));
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        Task <Item> IRepository <int, Item> .FindAsync(int identifier, CancellationToken cancellationToken)
        {
            IItemRepository self    = this;
            var             request = new ItemDetailsRequest
            {
                Identifier = identifier.ToString(NumberFormatInfo.InvariantInfo),
                Culture    = self.Culture
            };
            var responseTask = this.serviceClient.SendAsync <ItemDataContract>(request, cancellationToken);

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