diff --git a/Model/Student.cs b/Model/Student.cs index 4b95454..aab7197 100644 --- a/Model/Student.cs +++ b/Model/Student.cs @@ -11,5 +11,6 @@ namespace Spg.BasicDemo.Model { public string FirstName { get; set; } public string LastName { get; set; } public long SozNumber { get; set; } + public int Id { get; internal set; } } } diff --git a/Program.cs b/Program.cs index 34c8db2..e99ce78 100644 --- a/Program.cs +++ b/Program.cs @@ -4,24 +4,44 @@ using Spg.BasicDemo.Model; using System.Reflection; -string s = "Hello, world!"; +internal class Program { + private static void Main(string[] args) { + string s = "Hello, world!"; -Console.WriteLine(s); + Console.WriteLine(s); -Student student = new Student(); -student.FirstName = "Martin"; -student.LastName = "Schrutek"; -student.Id = 1; + + Student student = new Student(); + student.FirstName = "Martin"; + student.LastName = "Schrutek"; + student.Id = 1; -student.Id.ToString(); + student.Id.ToString(); -bool isEqual = student.Equals(new Student()); + bool isEqual = student.Equals(new Student()); -// Reflections -PropertyInfo[] properties = student.GetType().GetProperties(); + // Reflections + PropertyInfo[] properties = student.GetType().GetProperties(); -foreach (PropertyInfo property in properties) { - Console.Out.WriteLine(property.Name); -} + foreach (PropertyInfo property in properties) { + Console.Out.WriteLine(property.Name); + } + int? e = null; + int? f = null; + int g = 0; + + Console.WriteLine(e ?? f ?? 5); + g = e ?? 0; + + Console.WriteLine(g); + + //string s3 = null; + string s3 = "Goodbye, world!"; + Console.WriteLine($"Length = {s3?.Length ?? 0}"); + + bool y = 5 == 5 ? true : false; + Console.WriteLine(y); + } +} \ No newline at end of file diff --git a/bin/Debug/net6.0/Spg.BasicDemo.dll b/bin/Debug/net6.0/Spg.BasicDemo.dll index c4298c8..6397ced 100644 Binary files a/bin/Debug/net6.0/Spg.BasicDemo.dll and b/bin/Debug/net6.0/Spg.BasicDemo.dll differ diff --git a/bin/Debug/net6.0/Spg.BasicDemo.pdb b/bin/Debug/net6.0/Spg.BasicDemo.pdb index d9c4684..22c85a8 100644 Binary files a/bin/Debug/net6.0/Spg.BasicDemo.pdb and b/bin/Debug/net6.0/Spg.BasicDemo.pdb differ diff --git a/obj/Debug/net6.0/Spg.BasicDemo.csproj.CoreCompileInputs.cache b/obj/Debug/net6.0/Spg.BasicDemo.csproj.CoreCompileInputs.cache index b0adac0..a5c0c0d 100644 --- a/obj/Debug/net6.0/Spg.BasicDemo.csproj.CoreCompileInputs.cache +++ b/obj/Debug/net6.0/Spg.BasicDemo.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -f859f888a51e1a4435b0c78c05e2d5e0bb4e7cbc +894e3e29235fe86dbebdadba5ec62bc46a878ace diff --git a/obj/Debug/net6.0/Spg.BasicDemo.dll b/obj/Debug/net6.0/Spg.BasicDemo.dll index c4298c8..6397ced 100644 Binary files a/obj/Debug/net6.0/Spg.BasicDemo.dll and b/obj/Debug/net6.0/Spg.BasicDemo.dll differ diff --git a/obj/Debug/net6.0/Spg.BasicDemo.pdb b/obj/Debug/net6.0/Spg.BasicDemo.pdb index d9c4684..22c85a8 100644 Binary files a/obj/Debug/net6.0/Spg.BasicDemo.pdb and b/obj/Debug/net6.0/Spg.BasicDemo.pdb differ diff --git a/obj/Debug/net6.0/ref/Spg.BasicDemo.dll b/obj/Debug/net6.0/ref/Spg.BasicDemo.dll index a3433c4..596a501 100644 Binary files a/obj/Debug/net6.0/ref/Spg.BasicDemo.dll and b/obj/Debug/net6.0/ref/Spg.BasicDemo.dll differ diff --git a/obj/Debug/net6.0/refint/Spg.BasicDemo.dll b/obj/Debug/net6.0/refint/Spg.BasicDemo.dll index a3433c4..596a501 100644 Binary files a/obj/Debug/net6.0/refint/Spg.BasicDemo.dll and b/obj/Debug/net6.0/refint/Spg.BasicDemo.dll differ