public IEnumerable <Country> GetAllCountries() { try { db.GetCountries(); return(db.Countries.Values); } catch (Exception) { throw; } }
protected void btnLoadCountries_Click(object sender, EventArgs e) { DbTools db = new DbTools(); GridView1.DataSource = db.GetCountries().Values; GridView1.DataBind(); }
private void FormMain_Load(object sender, EventArgs e) { db = new DbTools(); db.GetCountries(); db.GetDrivers(); teams = new BindingList <Team>(db.LoadTeams()); listBoxTeam.DataSource = teams; }
public IHttpActionResult GetCountry(string id) { try { db.GetCountries(); if (db.Countries[id] == null) { return(NotFound()); } return(Ok(db.Countries[id])); } catch (Exception) { return(NotFound()); } }
public IEnumerable <Country> GetAllCountries() { db.GetCountries(); return(db.Countries.Values); }