コード例 #1
0
        public ESResultModel Search(string taxId = "", string name = "", string city = "")
        {
            Logger.Debug($"{CorrelationId} - Request with query:{{taxId:{taxId}, name: {name}, city: {city}}} started");
            Stopwatch timer = Stopwatch.StartNew();

            string url = PrepareUrl(new Dictionary <string, string>
            {
                {
                    "ico",
                    taxId
                },
                {
                    "obch_jm",
                    name
                },
                {
                    "obec",
                    city
                }
            });

            Logger.Debug($"{CorrelationId} - Generated Url for ES request: {url}");

            Ares_odpovedi aresResponse = WebRequestHelper.XmlWebRequestSequence <Ares_odpovedi>(
                url);

            Logger.Debug($"{CorrelationId} - Got response from ARES. Time:{timer.Elapsed}");
            timer.Restart();

            ESResultModel result = BaseMapper.MapESData(aresResponse);

            Logger.Debug($"{CorrelationId} - Ares response mapped. Time:{timer.Elapsed}");
            return(result);
        }