repl.it
@kironroy/

fields

C#

readonly, string interpolation

fork
loading
Files
  • main.cs
  • Customer.cs
  • main.exe
  • notes.txt
  • Order.cs
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fields
{

    class Program
    {
        static void Main(string[] args)
        {
            var customer = new Customer(1);
            customer.Orders.Add(new Order());
            customer.Orders.Add(new Order());

           
          // string interpolation
            Console.WriteLine($"There are {customer.Orders.Count} customers");


            

        }

        
    }
}