public bool SaveToDatabase(DateTime holidayDate, LocationEnum location) { if (holidayDate == null) { throw new ArgumentException("holidayDate"); } return(holidayControllerProxy.save(location.ToString(), holidayDate.ToShortDateString(), configManager.CurrentUser)); }
/// <summary> /// Construct the Http client and set it depending /// on the League of legends server location /// </summary> /// <param name="location">League of legends server location</param> private protected ApiService(LocationEnum location) { Client = new HttpClient() { BaseAddress = new Uri(string.Format(BaseAdressTemplate, location.ToString().ToLower())) }; Client.DefaultRequestHeaders.Add("X-Riot-Token", Environment.GetEnvironmentVariable("RIOTGAMES_API_TOKEN")); Client.DefaultRequestHeaders.Add("Accept", "application/json"); }
/// <summary> /// Configure on each server the Api calls /// will be made /// </summary> /// <param name="location">Server location to set</param> public void ConfigureLocation(LocationEnum location) => Client.BaseAddress = new Uri(String.Format(BaseAdressTemplate, location.ToString().ToLower()));