1 of 40

2 of 40

Thoughts of a Team Leader about .Net6

Giorgio Desideri - Seven Peaks Software

3 of 40

Myself

4 of 40

Agenda

  • Introduction
  • C# 10 features
  • Minimal API
  • ASP.NET 6

5 of 40

Introduction

Something to know before

6 of 40

What I am going to present you ?

  • I am going to share with you
    • My experiences and thoughts
    • My suggestions about the approach for development
  • I am aiming to
    • Inspire you
    • Give you a point of reflection
    • Enjoy you

7 of 40

How to read this presentation ?

  • I will present the topic
  • I will share with you my thoughts and my ideas derive by my experience
  • These thoughts can be true or not
    • according to my nickname ( “Cassandra” ) will be true at 99% !

8 of 40

C# 10 Features

Starting with the “main dish”

9 of 40

`using` keyword

  • Implicit `using` directives

10 of 40

`using` keyword

  • Global `using` directives
  • Use old program style

11 of 40

“Cassandra” says ...

  • Keep the old program style for “compatibility” => LEGACY
    • Project or Product will never have enough time and budget to upgrade ( until end of support comes )

  • Never use .Net 6 as .Net 6
    • “It is easy, just use the ‘old style’ configuration”
    • “Why change it ? I can copy from Microsoft, so it works !”

12 of 40

“Cassandra” says ...

  • Global directive
    • global using MyProject.Commons;
    • global using MyProject.Domains;
    • global using MyProject.Infrastructure;
    • global using MyProject.Interface;
    • ...

    • BUT The Best should come ...

13 of 40

“Cassandra” says ...

global using $world;

OR

global using org.nuget.*;

14 of 40

record

  • record
    • immutable
    • based on value-equality
    • toString() built-in for display
    • have the support for inheritance hierarchies

15 of 40

“Cassandra” says ...

  • Data-driven applications
    • Special benefits for people which are working in ML or Big Data
    • Thread-safe and concurrency execution ( ex. OLAP )

  • Thread-safe
    • “What is that ? I never heard that.”
    • “Immutable ? Easy remove set; from my properties ”

16 of 40

Minimal API

Starting to go seriously

17 of 40

Basic Concepts

What is Minimal API (application) ?

18 of 40

Example

19 of 40

“Cassandra” says ...

  • Thanks
    • to .Net community to restructure Host with Generic and Web

  • For microservice is good …. but
    • When is the moment to design your application as microservice ?
    • Are you sure that your microservice will be “MINIMAL” ?
    • Maintain-ability and future Development effort ?

20 of 40

“Cassandra” says ...

  • It is Faster ...
    • How work the “normal” MVC, or Controller ?
    • How work the previous example ?

  • The Prophecy
    • Pay attention to the 7th endpoint
    • Avoid the HTTP PATCH over-usage
    • Use .Net6 as .Net6 not as .Net5

21 of 40

ASP.NET 6

Something normal

22 of 40

ASP.NET 6

  • Blazor enhancement
  • Razor Controller improvements
  • SignalR improvements
  • Kestrel
  • Others
    • Logging
    • Code Analysis
    • Hot Reload

23 of 40

“Cassandra” says ...

  • Welcome to the new “functionalities”
    • Don’t mess all in a single commit

  • Startup.cs … T.T
    • Bye Bye
    • Unification with Program.cs
    • For Test:
      • ProgramTest.cs ?
      • if / else if /else with ASPNETCORE_ENVIRONMENT values ?

24 of 40

“Cassandra” says ...

  • Logging
    • Make easy the configuration
    • HTTP Logging
      • Request and Response log

  • Code Analysis
    • Link here
    • Don’t suppress them, Use them !

25 of 40

“Cassandra” says ...

  • Hot Reload
    • it works on my Debian 11 laptop ( “on my pc works” )
    • Boost the development ?
      • I don’t know, for my approach doesn’t
    • Debugging activity
      • wasting time
      • “not-replic-ability”
    • Logging helps me more
      • maybe because I am old and I read the code, and I don’t debug

26 of 40

Questions?

Open to discuss and reply

27 of 40

Thanks for joining!

Giorgio Desideri @ Seven Peaks Software

28 of 40

Announcemnet

  • Value prop 1
  • Value prop 2
  • Value prop 3

RELEASED

29 of 40

30 of 40

31 of 40

32 of 40

33 of 40

34 of 40

35 of 40

36 of 40

37 of 40

38 of 40

39 of 40

40 of 40