Skip to content

JdMary/airport-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IEnumerable → Use when you only need to iterate over elements (read-only).

ICollection → Use when you need to modify elements but don't need index-based access.

IList → Use when you need full list functionality, including indexing.

public void showFlightDetails(Plane plane)
{
    var query = flights
        .Where(f => f.Plane == plane)  
        .Select(f => new { f.FlightDate, f.Destination }); 

    foreach (var flight in query)
        Console.WriteLine($"Destination: {flight.Destination}, FlightDate: {flight.FlightDate}");
}

  • Where(f => f.Plane == plane) → Filters the flights collection based on the given plane.
  • Select(f => new { f.FlightDate, f.Destination }) → Extracts only necessary properties.

string connectionString = "Server=your_server;Database=your_database;User Id=your_username;Password=your_password;";

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages