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); }
public IEnumerable <Country> Get() { DbTools db = new DbTools(); return(db.GetListCountry()); }
public List <Country> GetAllCountries() { return(db.GetListCountry("SELECT * FROM Countries;")); }