示例#1
0
        /// <inheritdoc />
        Guild IRepository <Guid, Guild> .Find(Guid identifier)
        {
            var request = new GuildRequest
            {
                GuildId = identifier
            };
            var response = this.serviceClient.Send <GuildDTO>(request);

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

            return(this.guildConverter.Convert(response.Content, null));
        }
示例#2
0
        /// <inheritdoc />
        Guild IGuildRepository.FindByName(string name)
        {
            var request = new GuildRequest
            {
                GuildName = name
            };
            var response = this.serviceClient.Send <GuildDTO>(request);

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

            return(this.guildConverter.Convert(response.Content, null));
        }
示例#3
0
        /// <inheritdoc />
        async Task <Guild> IGuildRepository.FindByNameAsync(string name, CancellationToken cancellationToken)
        {
            var request = new GuildRequest
            {
                GuildName = name
            };
            var response = await this.serviceClient.SendAsync <GuildDTO>(request, cancellationToken).ConfigureAwait(false);

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

            return(this.guildConverter.Convert(response.Content, response));
        }
示例#4
0
        /// <inheritdoc />
        async Task <Guild> IRepository <Guid, Guild> .FindAsync(Guid identifier, CancellationToken cancellationToken)
        {
            var request = new GuildRequest
            {
                GuildId = identifier
            };
            var response = await this.serviceClient.SendAsync <GuildDTO>(request, cancellationToken).ConfigureAwait(false);

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

            return(this.guildConverter.Convert(response.Content, response));
        }