Ejemplo n.º 1
0
        /// <inheritdoc />
        Skin IRepository <int, Skin> .Find(int identifier)
        {
            ISkinRepository self    = this;
            var             request = new SkinDetailsRequest
            {
                SkinId  = identifier,
                Culture = self.Culture
            };
            var response = this.serviceClient.Send <SkinDataContract>(request);

            if (response.Content == null)
            {
                return(null);
            }

            var skin = this.converterForSkin.Convert(response.Content, null);

            if (skin == null)
            {
                return(null);
            }

            skin.Culture = request.Culture;

            return(skin);
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        Task <Skin> IRepository <int, Skin> .FindAsync(int identifier, CancellationToken cancellationToken)
        {
            ISkinRepository self    = this;
            var             request = new SkinDetailsRequest
            {
                SkinId  = identifier,
                Culture = self.Culture
            };
            var responseTask = this.serviceClient.SendAsync <SkinDataContract>(request, cancellationToken);

            return(responseTask.ContinueWith(task => this.OnAsyncResponse(task, request.Culture), cancellationToken));
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        async Task <Skin> IRepository <int, Skin> .FindAsync(int identifier, CancellationToken cancellationToken)
        {
            ISkinRepository self    = this;
            var             request = new SkinDetailsRequest
            {
                SkinId  = identifier,
                Culture = self.Culture
            };
            var response = await this.serviceClient.SendAsync <SkinDTO>(request, cancellationToken).ConfigureAwait(false);

            if (response.Content == null)
            {
                return(null);
            }

            var skin = this.skinConverter.Convert(response.Content, response);

            skin.Culture = request.Culture;
            return(skin);
        }