示例#1
0
        public static async Task <Results> Search(LG.Data.Models.Shared.ValueItem item)
        {
            var client = ClientConnection.GetCmsConnection();

            try
            {
                client.Open();
                var response = await client.SearchClientAsync(new SearchClientRequest()
                {
                    SearchInput         = item.Value,
                    IsIncludeStartsWith = true,
                    IsIncludeContains   = true,
                    MessageGuid         = Guid.NewGuid()
                });

                client.Close();
                var results = new Results();
                response.Clients.ForEach(record => results.List.Add(
                                             ParseClient(record)));
                return(results);
            }
            catch (Exception ex)
            {
                client.Close();
                return(new LG.Data.Models.Clients.Results
                {
                    IsError = true,
                    Message = ex.Message.ToString(CultureInfo.InvariantCulture)
                });
            }
        }
示例#2
0
 public static async Task <Results> Search(LG.Data.Models.Shared.ValueItem item)
 {
     return(await LG.Data.Core.Clients.SearchDataService.Search(item));
 }