Added 6.24 and 6.25
ADD
src/Chapter06/Listing06.24.CILCodeResultingFromProperties.cs
+// Non-nullable field is uninitialized. Consider declaring as nullable.
+#pragma warning disable CS8618 // Pending a constructors
+
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_23
+{
+ class Program
+ {
+ static void Main()
+ {
+ Employee employee1 = new Employee();
+ employee1.Initialize(42);
+ // ERROR: The property or indexer 'Employee.Id'
+ // cannot be used in this context because the set
+ // accessor is inaccessible
+ // employee1.Id = "490"; //will not compile if you uncomment this line
+ }
+ }
+
+ class Employee
+ {
+ public void Initialize(int id)
+ {
+ // Set Id property
+ Id = id.ToString();
+ }
+
+ // ...
+ // Id property declaration
+ public string Id
+ {
+ get => _Id;
+ private set => _Id = value;
+ }
+ private string _Id;
+ }
+}

ADD
src/Chapter06/Listing06.25.PropertiesAreAnExplicitConstructInCIL.cs
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_25
+{
+ .property instance string FirstName()
+ {
+ .get instance string Program::get_FirstName()
+ .set instance void Program::set_FirstName(string)
+ } // End of property Program::FirstName
+
+}

Added 6.24 and 6.25