Exemplo n.º 1
0
        public async Task <JsonClasses.SearchResult> SearchMemberEntity(string reason, string value, bool isAggressive = false)
        {
            var searchValue = HttpUtility.UrlEncode(value);

            if (isAggressive)
            {
                return((await APIHelper.AggressiveESIRequestWrapper <JsonClasses.SearchResult>($"{SettingsManager.Settings.Config.ESIAddress}latest/search/?categories=alliance,character,corporation&datasource=tranquility&search={searchValue}&strict=true", reason, 10))?.Result);
            }
            return(await APIHelper.RequestWrapper <JsonClasses.SearchResult>($"{SettingsManager.Settings.Config.ESIAddress}latest/search/?categories=alliance,character,corporation&datasource=tranquility&search={searchValue}&strict=true", reason));
        }
Exemplo n.º 2
0
        private async Task <T> GetAgressiveESIEntry <T>(string url, string reason, object id, int retries)
            where T : class
        {
            if (id == null || id.ToString() == "0")
            {
                return(null);
            }
            var data = await GetFromDbCache <T>(id, 1);

            if (data == null)
            {
                var result = await APIHelper.AggressiveESIRequestWrapper <T>(url, reason, retries);

                if (!result.Data.IsFailed)
                {
                    data = result.Result;
                    if (data != null)
                    {
                        await UpdateDbCache(data, id, 1);
                    }
                }
            }
            return(data);
        }