コード例 #1
0
        public List <DTO.DriverDetailsDTO> GetDriverDetailsDTO()
        {
            List <DTO.DriverDetailsDTO> driverList = new List <DTO.DriverDetailsDTO>();

            foreach (var driver in db.GetListDriver("SELECT * FROM Driver"))
            {
                var country = db.GetListCountry($"SELECT * FROM Countries WHERE countryCode='{driver.countryCode}';");
                driverList.Add(new DTO.DriverDetailsDTO(
                                   driver.driverNumber,
                                   driver.driverName,
                                   driver.driverSurname,
                                   driver.img,
                                   db.GetListTeams($"SELECT * FROM Team WHERE teamCode='{driver.teamCode}';")[0].teamFullName,
                                   country[0].countryName,
                                   country[0].countryCode,
                                   driver.points));
            }
            return(driverList);
        }
コード例 #2
0
        public IEnumerable <Country> Get()
        {
            DbTools db = new DbTools();

            return(db.GetListCountry());
        }
コード例 #3
0
 public List <Country> GetAllCountries()
 {
     return(db.GetListCountry("SELECT * FROM Countries;"));
 }