Skip to content

Commit

Permalink
more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatandrei committed Nov 30, 2023
1 parent e15996f commit c8674bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion 2023/Net8WhatsNew/code/WhatsNewC12/WhatsNewC12/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12
using WhatsNewC12;
using static System.Runtime.InteropServices.JavaScript.JSType;
using Point = (int x, int y);
Console.WriteLine("More differences at https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12");
Console.WriteLine("record vs class");
var pc=new PersonClass("Ignat", "Andrei");
Expand All @@ -10,4 +12,12 @@
Console.WriteLine(pr.firstName);
//this does not exists - because it is a class!
//Console.WriteLine(pc.LastName);
Console.WriteLine(pr.lastName);
Console.WriteLine(pr.lastName);
Point p=new(1,2);
Console.WriteLine(p.ToString());

int[] a=[1,2,3];
List<int> b = [1,2,3];
int[] moreNumbers = [.. a, .. b, 7, 8, 9];
//Dictionary<int, string> c = [1:"one", 2:"two", 3:"three"];

2 changes: 2 additions & 0 deletions 2023/Net8WhatsNew/presentation/NET8WhatsNew.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@

Primary constructors and differences for record (DEMO)

Alias for any type ( DEMO )
Collection literals (DEMO )
Interceptors ( see asp.net core 8 for examples of MapGet ,MapPost ...)


Expand Down

0 comments on commit c8674bf

Please # to comment.