layout: true
--- class: center, middle # WhatsNewNet6 => ( press > ) https://ignatandrei.github.io/Presentations/WhatsNewNet6prez.html Code at https://ignatandrei.github.io/Presentations/WhatsNewNet6.zip --- # Agenda 0. About me 1. What's new VS2022? 2. What's new C# 10 3. What's new ASP.NET C# 10 4. What's new EFCore 6 5. Links 7. Discussion / Questions ? --- class: center, top # About me ![:img ignat, 10%](ignat.jpg) Andrei Ignat http://msprogrammer.serviciipeweb.ro/ www.ASP.NET forum moderator YouTube 5 minutes .NET and tools : http://bit.ly/5MinTools Book Making Open Source Component : http://bit.ly/NetOpenSourceComponent Book Copy Paste from StackOverflow : https://amzn.to/2PQ8EDc Roslyn Source Code Generators with examples : Amazon: https://amzn.to/3f6gll3 Free: https://ignatandrei.github.io/RSCG_Examples/ Monthly meetings: https://www.meetup.com/Bucharest-A-D-C-E-S-Meetup/ --- class: center, top # What's new VS2022? 64 Bit Intellicode - AI powered like Github Copilot Conditional Breakpoint + Force Run to Cursor Not tried yet: committing across many repos: https://devblogs.microsoft.com/visualstudio/multi-repo-support-in-visual-studio/ Razor editor: https://devblogs.microsoft.com/visualstudio/introducing-the-new-razor-editor-in-visual-studio-2022/ More details at : https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview --- class: top # What's new C# 10 DotNet: https://devblogs.microsoft.com/dotnet/file-io-improvements-in-dotnet-6/ 1. Demo :Minimal program , Implicit usings ,global usings, ```csharp WriteLine("Hello Worldx"); CsharpVsPython(); ``` 2. //Demo: file scoped namespaces 3. Demo: CallerArgumentExpression 4. Demo: Source generator for System.Text.Json (and logging) 5. DateOnly, TimeOnly : https://devblogs.microsoft.com/dotnet/date-time-and-time-zone-enhancements-in-net-6/ --- class: top # What's new ASP.NET C# 10 https://docs.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-6.0?view=aspnetcore-6.0 1. Demo: Minimal API ; then Razor , Blazor , IAsyncDisposable 2. HttpLoggingMiddleware 3. Demo: AsyncEnumerable ```csharp [HttpGet] public async IAsyncEnumerable
GetValues(){ for (int i = 0; i < 10; i++) { await Task.Delay(2000); yield return i; } } ``` 4. Linq API : //Demo: MaxBy , //Demo: Chunk : example with threads 6. Value Type Records ( equality not by reflection) 7. Interpolated string : https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/interpolated-string-handler (see latest example) --- class: top # What's new EFCore 6
1. Minimal API + Speed 2. Compiled Models : https://devblogs.microsoft.com/dotnet/announcing-entity-framework-core-6-0-preview-5-compiled-models/ dotnet ef dbcontext optimize ```csharp var iddepartment = runtimeEntityType.AddProperty( "Iddepartment", typeof(long), propertyInfo: typeof(Department).GetProperty("Iddepartment", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(Department).GetField("
k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), valueGenerated: ValueGenerated.OnAdd, afterSaveBehavior: PropertySaveBehavior.Throw); ``` 3. Conventions - varchar(200) for all string columns https://devblogs.microsoft.com/dotnet/announcing-entity-framework-core-6-0-preview-6-configure-conventions/ ```csharp configurationBuilder.Properties
() .AreUnicode(false).HaveMaxLength(1024); ``` 4. Support Temporal Tables 5. Migrations, Cosmos DB, SavePoints, and others :https://docs.microsoft.com/ro-ro/ef/core/what-is-new/ef-core-6.0/whatsnew
--- class: center, top # Links to get started https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-6 https://devblogs.microsoft.com/dotnet/file-io-improvements-in-dotnet-6/ https://devblogs.microsoft.com/dotnet/announcing-net-6/ https://devblogs.microsoft.com/dotnet/welcome-to-csharp-10/ https://devblogs.microsoft.com/dotnet/try-the-new-system-text-json-source-generator/ https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-6.0/whatsnew https://docs.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-6.0?view=aspnetcore-6.0 http://dontcodetired.com/blog/?tag=cs10newseries https://devblogs.microsoft.com/dotnet/get-to-know-ef-core-6/ https://docs.microsoft.com/ro-ro/ef/core/what-is-new/ef-core-6.0/whatsnew https://blog.ndepend.com/modern-c-hello-world/ https://devblogs.microsoft.com/visualstudio/visual-studio-2022/ https://devblogs.microsoft.com/visualstudio/multi-repo-support-in-visual-studio/ https://devblogs.microsoft.com/visualstudio/introducing-the-new-razor-editor-in-visual-studio-2022/ https://visualstudiomagazine.com/articles/2021/11/08/vs-2022-ga.aspx https://kymphillpotts.com/dotnetconf-recap.html --- class: left, top # Questions? Andrei Ignat http://msprogrammer.serviciipeweb.ro/ www.ASP.NET forum moderator YouTube 5 minutes .NET and tools : http://bit.ly/5MinTools Book Making Open Source Component : http://bit.ly/NetOpenSourceComponent Book Copy Paste from StackOverflow : https://amzn.to/2PQ8EDc Roslyn Source Code Generators with examples : Amazon: https://amzn.to/3f6gll3 Free: https://ignatandrei.github.io/RSCG_Examples/ Monthly meetings: https://www.meetup.com/Bucharest-A-D-C-E-S-Meetup/