コード例 #1
0
 public IEnumerable <Country> GetAllCountries()
 {
     try
     {
         db.GetCountries();
         return(db.Countries.Values);
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #2
0
        protected void btnLoadCountries_Click(object sender, EventArgs e)
        {
            DbTools db = new DbTools();

            GridView1.DataSource = db.GetCountries().Values;
            GridView1.DataBind();
        }
コード例 #3
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     db = new DbTools();
     db.GetCountries();
     db.GetDrivers();
     teams = new BindingList <Team>(db.LoadTeams());
     listBoxTeam.DataSource = teams;
 }
コード例 #4
0
        public IHttpActionResult GetCountry(string id)
        {
            try
            {
                db.GetCountries();
                if (db.Countries[id] == null)
                {
                    return(NotFound());
                }

                return(Ok(db.Countries[id]));
            }
            catch (Exception)
            {
                return(NotFound());
            }
        }
コード例 #5
0
 public IEnumerable <Country> GetAllCountries()
 {
     db.GetCountries();
     return(db.Countries.Values);
 }