public FullWrapper GetFullWrapper() { if (FullWrapper != null) { return(FullWrapper); } if (Values.ContainsKey(typeof(Full)) && Values[typeof(Full)] != null) { FullWrapper = new FullWrapper((Full)Values[typeof(Full)]); FullWrapper.AddPartnerWrapper(); return(FullWrapper); } else { } return(null); }
public async Task <T> Update <T>(string apiKey) where T : BaseQueslar, new() { Valid = false; var client = new HttpClient(); BaseQueslar info = new T(); apiKey = apiKey.Trim(); try { info = await client.GetFromJsonAsync <T>("https://queslar.com/api/" + info.ApiPath + apiKey); Values[typeof(T)] = info; if (info.GetType() == typeof(Full)) { FullWrapper = new FullWrapper((Full)info); FullWrapper.AddPartnerWrapper(Tax); } } catch (Exception) { return(null); } Valid = true; ApiKey = apiKey; return((T)info); }