C# Foundations · Lesson 15

Several files

A project can hold a type in one file and the entry in another.

How it works

Order.cs holds the Order record: an id, an amount, and whether it was paid. Program.cs stays the entry and can construct an Order. Run still starts at Program.cs. Saving the open file does not save a different file you have not edited.

A working example

public sealed record Order(
    string Id,
    decimal Amount,
    bool IsPaid);

Try this
Save the file you mean to keep.