Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pattern matching with objects: Defining flight passengers #38

Closed
MAS-OUD opened this issue Mar 8, 2023 · 2 comments
Closed

Pattern matching with objects: Defining flight passengers #38

MAS-OUD opened this issue Mar 8, 2023 · 2 comments

Comments

@MAS-OUD
Copy link
Contributor

MAS-OUD commented Mar 8, 2023

On pages 242 through 244, to be able to run the flight passengers example I have to add the line using static Packt.Shared.FlightPatterns; or prefix class names with FlightPatterns..

@markjprice
Copy link
Owner

markjprice commented Mar 8, 2023

image

On page 241, the FlightPatterns.cs file should look like this:

namespace Packt.Shared;

public class Passenger
{
  public string? Name { get; set; }
}
// and so on

Note that all the classes are defined in the Packt.Shared file-scoped namespace.

You must have created a nested class declaration like this:

namespace Packt.Shared;

public class FlightPatterns
{
  public class Passenger
  {
    public string? Name { get; set; }
  }
// and so on

@markjprice
Copy link
Owner

@MAS-OUD MAS-OUD closed this as completed Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants