public List <AppointmentModel> GetAppointments() { var result = new List <AppointmentModel>(); MySqlConnection connection = new MySqlConnection { ConnectionString = _AppSettings.ConnectionString }; connection.Open(); MySqlCommand command = new MySqlCommand("SELECT * FROM appointments order by Id desc;", connection); using (MySqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { result.Add(AppointmentModel.Create(reader)); } } connection.Close(); return(result); }