コード例 #1
0
        public async Task <SuggestResponse <Fullname> > SuggestName(string query, int count             = 5,
                                                                    CancellationToken cancellationToken = default)
        {
            var request = new SuggestNameRequest(query, count);

            return(await SuggestName(request, cancellationToken));
        }
コード例 #2
0
        public void SuggestFioPartsTest()
        {
            var query = new SuggestNameRequest("викт");

            query.parts = new FullnamePart[] { FullnamePart.SURNAME };
            var response = api.SuggestName(query);

            Assert.AreEqual("Викторова", response.suggestions[0].data.surname);
            Console.WriteLine(string.Join("\n", response.suggestions));
        }
コード例 #3
0
        public void SuggestNameGenderTest()
        {
            var request = new SuggestNameRequest("виктор")
            {
                gender = Gender.FEMALE
            };
            var response = api.SuggestName(request);

            Assert.Equal("Виктория", response.suggestions[0].data.name);
            Console.WriteLine(string.Join("\n", response.suggestions));
        }
コード例 #4
0
        public async Task SuggestNamePartsTest()
        {
            var request = new SuggestNameRequest("викт")
            {
                parts = new[] { FullnamePart.SURNAME }
            };
            var response = await api.SuggestName(request);

            Assert.Equal("Викторова", response.suggestions[0].data.surname);
            Console.WriteLine(string.Join("\n", response.suggestions));
        }
コード例 #5
0
 public async Task <SuggestResponse <Fullname> > SuggestName(SuggestNameRequest request)
 {
     return(await Execute <SuggestResponse <Fullname> >(method : SuggestionsMethod.Suggest, entity : SuggestionsEntity.Name, request : request));
 }
コード例 #6
0
        public async Task <SuggestResponse <Fullname> > SuggestName(string query, int count = 5)
        {
            var request = new SuggestNameRequest(query, count);

            return(await SuggestName(request));
        }
コード例 #7
0
ファイル: SuggestClient.cs プロジェクト: jadvei/dadata-csharp
        public SuggestResponse <Fullname> SuggestName(string query, int count = 5)
        {
            var request = new SuggestNameRequest(query, count);

            return(SuggestName(request));
        }
コード例 #8
0
 public async Task <SuggestResponse <Fullname> > SuggestName(SuggestNameRequest request,
                                                             CancellationToken cancellationToken = default)
 {
     return(await Execute <SuggestResponse <Fullname> >(method : SuggestionsMethod.Suggest,
                                                        entity : SuggestionsEntity.Name, request : request, cancellationToken : cancellationToken));
 }