ASP.NET Core Features and architecture By Yan Gorshkov Event Name Play hys-enterprise.com
HYS Enterprise is a Dutch software development company with more than 200 talented engineers from all over the world hys-enterprise.com Ukraine Netherlands
About me • Middle Full Stack .Net Developer • 3 years at HYS Enterprise • Back-end skills: C#, ASP.Net Core, EF Core • Front-end skills: TypeScript, Angular ASP.NET Core. Features and architecture
About webinar • ASP.NET Core general overview • Generic Host: creating and starting • Startup class and Environments • Middlewares and Logging • Built-in DI-container • Configuration and options pattern • Types of project ASP.NET Core. Features and architecture
.NET 5 and ASP.NET ASP.NET Core. Features and architecture
Demo: .NET CLI and First ASP.NET Application ASP.NET Core. Features and architecture
Generic Host The CreateDefaultBuilder method: • Sets the content root; • Load host configuration (Environment variables prefixed with DOTNET_); • Loads app configuration; • Adds login providers (Console, Debug, EventSource). ASP.NET Core. Features and architecture The ConfigureWebHostDefaults method: • Loads host configuration from environment variables prefixed with ASPNETCORE_; • Sets Kestrel server as the web server and configures it using the app's hosting configuration providers; • Enables IIS integration • Allow you to configure http pipeline.
Startup class Startup class is a heart of ASP.NET Core app Contains 2 methods: • ConfigureServices (optional) – DI-container configuration; • Configure – HTTP request pipeline configuration. ASP.NET Core. Features and architecture
Middlewares The mechanism allows you to configure HTTP request pipeline from start to end. A short list of built-in middlewares: • Authentication; • Authorization; • CORS; • HTTPS redirection; • Session; • Static files. ASP.NET Core. Features and architecture
Demo: Create new middleware ASP.NET Core. Features and architecture
Routing The way to map an incoming request with a business logic Apps can configure routing using: • Endpoint-enabled middleware; • Controllers; • Razor Pages; • SignalR; • gRPC Services. ASP.NET Core. Features and architecture
Demo: Routing with UseEndpoints middleware ASP.NET Core. Features and architecture
Web API Application • Allows to create a RESTful API. • The way to structure your logic using controllers. • Allows to create an OpenAPI specification (Swаgger) Each controller has a set of actions (handlers) ASP.NET Core. Features and architecture
Demo: Creating Web API application via Visual Studio ASP.NET Core. Features and architecture
DI-Container • DI-Container – one place to register services (dependencies); • DI-Container manages the lifetime of objects; • Following Dependency Inversion principle, we can easily replace one service implementation with another for the whole project. ASP.NET Core. Features and architecture
Demo: Built-in DI-container ASP.NET Core. Features and architecture
Configuration • IConfiguration service allows us to get options from appsetings.json config file; • We can add environment-specific config file to override some options; • Options pattern introduces a mechanism to use complex configuration structures as objects. ASP.NET Core. Features and architecture
Demo: Configuration ASP.NET Core. Features and architecture
Types of ASP.NET projects • Empty project • Web API • Web API + Angular/React • MVC • Razor Pages • Blazor • gRPC service ASP.NET Core. Features and architecture
Web Servers • Kestrel – default, cross platform and lightweight web- server implementation; • HTTP.sys • IIS, Nginx, Apache can be used as reverse proxy ASP.NET Core. Features and architecture
Links • GitHub with examples: https://github.com/yan1998/ASPNETCoreWebinar • My Facebook: https://www.facebook.com/gorshkov.yan/ • My LinkedIn: https://www.linkedin.com/in/yan-gorshkov-898325137/ • ASP.NET Core docs: https://docs.microsoft.com/en-us/aspnet/core/introduction-to-aspnet-core?view=aspnetcore-5.0 • ASP.NET Core architecture: https://dotnet.microsoft.com/learn/aspnet/architecture ASP.NET Core. Features and architecture
Thank you For your attention! Any Questions? ASP.NET Core. Features and architecture

“ASP.NET Core. Features and architecture”

  • 1.
    ASP.NET Core Features andarchitecture By Yan Gorshkov Event Name Play hys-enterprise.com
  • 2.
    HYS Enterprise isa Dutch software development company with more than 200 talented engineers from all over the world hys-enterprise.com Ukraine Netherlands
  • 3.
    About me • MiddleFull Stack .Net Developer • 3 years at HYS Enterprise • Back-end skills: C#, ASP.Net Core, EF Core • Front-end skills: TypeScript, Angular ASP.NET Core. Features and architecture
  • 4.
    About webinar • ASP.NETCore general overview • Generic Host: creating and starting • Startup class and Environments • Middlewares and Logging • Built-in DI-container • Configuration and options pattern • Types of project ASP.NET Core. Features and architecture
  • 5.
    .NET 5 andASP.NET ASP.NET Core. Features and architecture
  • 6.
    Demo: .NET CLIand First ASP.NET Application ASP.NET Core. Features and architecture
  • 7.
    Generic Host The CreateDefaultBuildermethod: • Sets the content root; • Load host configuration (Environment variables prefixed with DOTNET_); • Loads app configuration; • Adds login providers (Console, Debug, EventSource). ASP.NET Core. Features and architecture The ConfigureWebHostDefaults method: • Loads host configuration from environment variables prefixed with ASPNETCORE_; • Sets Kestrel server as the web server and configures it using the app's hosting configuration providers; • Enables IIS integration • Allow you to configure http pipeline.
  • 8.
    Startup class Startup classis a heart of ASP.NET Core app Contains 2 methods: • ConfigureServices (optional) – DI-container configuration; • Configure – HTTP request pipeline configuration. ASP.NET Core. Features and architecture
  • 9.
    Middlewares The mechanism allowsyou to configure HTTP request pipeline from start to end. A short list of built-in middlewares: • Authentication; • Authorization; • CORS; • HTTPS redirection; • Session; • Static files. ASP.NET Core. Features and architecture
  • 10.
    Demo: Create newmiddleware ASP.NET Core. Features and architecture
  • 11.
    Routing The way tomap an incoming request with a business logic Apps can configure routing using: • Endpoint-enabled middleware; • Controllers; • Razor Pages; • SignalR; • gRPC Services. ASP.NET Core. Features and architecture
  • 12.
    Demo: Routing with UseEndpointsmiddleware ASP.NET Core. Features and architecture
  • 13.
    Web API Application •Allows to create a RESTful API. • The way to structure your logic using controllers. • Allows to create an OpenAPI specification (Swаgger) Each controller has a set of actions (handlers) ASP.NET Core. Features and architecture
  • 14.
    Demo: Creating WebAPI application via Visual Studio ASP.NET Core. Features and architecture
  • 15.
    DI-Container • DI-Container –one place to register services (dependencies); • DI-Container manages the lifetime of objects; • Following Dependency Inversion principle, we can easily replace one service implementation with another for the whole project. ASP.NET Core. Features and architecture
  • 16.
    Demo: Built-in DI-container ASP.NETCore. Features and architecture
  • 17.
    Configuration • IConfiguration serviceallows us to get options from appsetings.json config file; • We can add environment-specific config file to override some options; • Options pattern introduces a mechanism to use complex configuration structures as objects. ASP.NET Core. Features and architecture
  • 18.
  • 19.
    Types of ASP.NETprojects • Empty project • Web API • Web API + Angular/React • MVC • Razor Pages • Blazor • gRPC service ASP.NET Core. Features and architecture
  • 20.
    Web Servers • Kestrel– default, cross platform and lightweight web- server implementation; • HTTP.sys • IIS, Nginx, Apache can be used as reverse proxy ASP.NET Core. Features and architecture
  • 21.
    Links • GitHub withexamples: https://github.com/yan1998/ASPNETCoreWebinar • My Facebook: https://www.facebook.com/gorshkov.yan/ • My LinkedIn: https://www.linkedin.com/in/yan-gorshkov-898325137/ • ASP.NET Core docs: https://docs.microsoft.com/en-us/aspnet/core/introduction-to-aspnet-core?view=aspnetcore-5.0 • ASP.NET Core architecture: https://dotnet.microsoft.com/learn/aspnet/architecture ASP.NET Core. Features and architecture
  • 22.
    Thank you For yourattention! Any Questions? ASP.NET Core. Features and architecture