MVC Web Apps with ASP.NET 7

Last modified: 2022-11-07

Audience

Developers

Duration

5 days

Prerequisites

Programming with C# (Basic Skills)

Description

ASP.NET 7 is the latest framework for building web apps and services with .NET and C#. One recommended architecture is MVC, a development pattern based on Models, Views and Controllers.

We will build lots of different web apps during the course, showing the best practices and approches.

Course Outline


Introducing .NET 6 and ASP.NET Core

  • Evolution: From ".NET Framework" to ".NET" (via ".NET Core")
  • Comparing technologies
  • ASP.NET
  • Razor Pages
  • Blazor Pages (server)
  • Blazor Pages (Web Assembly)
  • MVC
  • Web API
  • SPA React

Configuring Middlewares and Services

  • Build an ASP.NET Application
  • Hosting for devs: Kestrel vs. IISExpress
  • Comparing:
    • New minimal hosting model
    • Classic hosting model
  • Managing Configuration
    • appSettings.json
    • Environment: Production vs. Development
    • Secret Manager
    • Environment variables
    • Configuring via command-line
  • Configuring Middlewares
    • Important Middlewares (static, etc.)
  • Configuring Services
    • Dependency Injection

Controllers

  • Create Controllers and Actions
  • Configuring Routes
  • Using "Actions Filters"

Views

  • Razor Syntax
  • Html Helpers and Tag Helpers
  • Reusing views
    • Partial Views
    • View Components

Models

  • Create Models
  • Working with Forms
  • Validating Data

Using Entity Framework

  • Entity Framework Fundamentals
  • Read and Write Data (Crud)
  • Connecting to Sql Server and SQLite

Layout, CSS, Javascript, Sass, Bootstrap, React

  • Position elements and apply layout
  • Asing Css
  • Adding Javascript
  • Compiling Sass
  • Generate a custom Bootstrap
  • Build a React SPA

Security

  • Identity (authentication)
  • Authorization
  • Protecting against attacks
    • Cross-Site Request Forgery
    • HTTPS
    • HSTS

Managing caching, state and logging

  • Create a caching strategy
  • Manage state
  • Modify logging options

Unit Testing and Deployment

  • Adding Unit Tests
  • Using Fakes and Mocks
  • Deploy a web app

Optional modules

In private training, we can customize by adding or modifying topics of interest.

Scaffolding models, Views, and controllers

  • Scaffolding tools fundamentals
  • modifying views and partial classes
  • Customizing templates

Data notification with SignalR

  • Creating a SignalR service
  • Client subscription to SignalR
  • Show and receive a notification

Developping with containers

  • Installing Docker
  • Using .NET with containers
  • Configuring containers
  • Deploy containers on Azure

Sharing data with "Web API" services

  • Creating REST Services
  • Configure OpenAPI and Swagger
  • Calling Web API Services from Client

Communicating with gRPC

  • Doing efficient communication with gRPC
  • Defining service with "Interface Definition Language"
  • Calling gRPC services from client.

Application Web with Razor pages

  • Razor Pages fundamentals
  • Razor Filters
  • Routing and conventions

Client apps With Blazor

  • Building interactive apps with Blazor
  • Creating Blazor Components
  • Routing and navigating
  • Convert an old "ASP.NET Web Forms" to a Blazor App