Section 1 of 6

What is ASP.NET Core?

🎯 What You'll Learn

  • What ASP.NET Core is and its purpose
  • The evolution from ASP.NET Framework to ASP.NET Core
  • Key features and benefits
  • Different application types you can build
  • How ASP.NET Core fits into the .NET ecosystem
  • Why ASP.NET Core is perfect for InvenTrack
  • Performance and scalability advantages

What is ASP.NET Core?

ASP.NET Core is a free, open-source, cross-platform framework for building modern, cloud-based, internet-connected applications. It's the web framework built on top of .NET that powers everything from simple websites to complex enterprise applications.

💡 Key Concept

Think of ASP.NET Core as a complete toolkit for building web applications. While .NET provides the foundation (runtime, libraries, language), ASP.NET Core adds everything specific to web development: handling HTTP requests, routing URLs, rendering HTML, serving APIs, managing sessions, and much more.

What Can You Build?

  • Web APIs: RESTful services for mobile apps, SPAs, and microservices
  • MVC Web Apps: Traditional server-rendered web applications
  • Razor Pages: Page-focused web apps (simpler than MVC)
  • Blazor Apps: Interactive web UIs using C# instead of JavaScript
  • Real-Time Apps: SignalR for WebSockets and real-time communication
  • gRPC Services: High-performance RPC framework
  • Microservices: Distributed, containerized services
🚀 For InvenTrack

We'll build InvenTrack as a Web API using ASP.NET Core. This gives us maximum flexibility—we can consume the API from web frontends, mobile apps, desktop applications, or even other services.

A Brief History

ASP.NET Framework (2002-2016)

The original ASP.NET was released in 2002 as part of the .NET Framework. It was revolutionary for its time but had limitations:

  • Windows-only (tied to IIS)
  • Monolithic architecture
  • Slow release cycles
  • Heavy memory footprint
  • Tightly coupled to System.Web.dll

ASP.NET Core (2016-Present)

In 2016, Microsoft released ASP.NET Core—a complete rewrite from the ground up. It addressed all the limitations of the old framework:

ASP.NET Framework ASP.NET Core
Windows-only Cross-platform (Windows, macOS, Linux)
IIS-dependent Self-hosted or IIS/Nginx/Apache
Monolithic Modular (install only what you need)
Slow Extremely fast (top TechEmpower benchmarks)
Closed source Open source (GitHub)
Infrequent updates Regular releases (yearly LTS)
ℹ️ Naming Note

ASP.NET Core 1.0-3.1: Named "ASP.NET Core"
ASP.NET Core 5.0+: Just called ".NET" (unified with .NET Core)
Common usage: Still referred to as "ASP.NET Core" for clarity

Key Features and Benefits

1. Cross-Platform

Develop on Windows, macOS, or Linux. Deploy to Windows Server, Linux, Docker containers, or cloud platforms (Azure, AWS, Google Cloud).

Cross-Platform Example Shell
# Develop on Windows
dotnet new webapi -n InvenTrack.Api
dotnet run

# Deploy to Linux Docker container
docker build -t inventtrack-api .
docker run -p 8080:80 inventtrack-api

2. High Performance

ASP.NET Core consistently ranks among the fastest web frameworks in the world. It's optimized for:

  • Minimal memory allocation
  • Efficient HTTP parsing
  • Asynchronous I/O by default
  • Response caching and compression
  • Kestrel web server (extremely fast)
🚀 Performance Numbers

In TechEmpower benchmarks, ASP.NET Core handles 7+ million requests/second on a single server—faster than Node.js, Go, and most other frameworks.

3. Built-in Dependency Injection

ASP.NET Core has dependency injection (DI) built into its core. This makes your code:

  • More testable
  • More maintainable
  • Loosely coupled
  • Following SOLID principles
Dependency Injection Example C#
// Register service
builder.Services.AddScoped<IProductService, ProductService>();

// Inject into controller
public class ProductsController : ControllerBase
{
    private readonly IProductService _productService;
    
    public ProductsController(IProductService productService)
    {
        _productService = productService;
    }
}

4. Middleware Pipeline

ASP.NET Core uses a middleware pipeline to process HTTP requests. Each middleware component can:

  • Handle the request and return a response
  • Process the request and pass it to the next middleware
  • Process the response on the way back
Middleware Pipeline Text
Request → [Authentication] → [Routing] → [Authorization] → [Endpoint] → Response
          ↓              ↓             ↓              ↓            ↓
       Logging      CORS Check    Rate Limit    Controller   JSON Result

5. Unified Programming Model

Whether you're building a Web API, MVC app, or Razor Pages site, you use the same:

  • Configuration system
  • Dependency injection
  • Middleware pipeline
  • Logging framework
  • Hosting model

6. Cloud-Ready

ASP.NET Core is designed for cloud deployment:

  • Environment-based configuration
  • Health checks
  • Distributed caching
  • Containerization support (Docker)
  • Azure integration (App Service, Functions, etc.)

ASP.NET Core Architecture

The Request Pipeline

Every HTTP request flows through ASP.NET Core like this:

Request Flow Text
1. HTTP Request arrives
   ↓
2. Kestrel web server receives it
   ↓
3. Middleware pipeline processes it
   ↓
4. Routing determines which endpoint to call
   ↓
5. Controller/Endpoint executes
   ↓
6. Response is generated
   ↓
7. Middleware processes response (reverse order)
   ↓
8. HTTP Response sent back to client

Key Components

Component Purpose
Kestrel Cross-platform web server
Middleware Request/response processing pipeline
Routing Maps URLs to endpoints
Controllers Handle requests and return responses
Model Binding Maps request data to C# objects
Validation Validates input data
Filters Cross-cutting concerns (auth, logging, etc.)

Application Types in Detail

Web API (RESTful Services)

Perfect for building backend services that serve JSON/XML data to clients.

Web API Example C#
[ApiController]
[Route("api/[controller]")]
public class ProductsController : ControllerBase
{
    [HttpGet]
    public ActionResult<IEnumerable<Product>> GetProducts()
    {
        return Ok(products);
    }
}

Use for: InvenTrack API, mobile backends, microservices

MVC (Model-View-Controller)

Traditional server-rendered web applications with separation of concerns.

Use for: Admin dashboards, content management systems

Razor Pages

Page-focused model, simpler than MVC for page-centric scenarios.

Use for: Simple websites, forms, CRUD operations

Blazor

Build interactive web UIs using C# instead of JavaScript. Runs in the browser via WebAssembly or on the server.

Use for: Rich, interactive web applications without JavaScript

Why ASP.NET Core for InvenTrack?

Requirement How ASP.NET Core Delivers
RESTful API Built-in Web API support with automatic JSON serialization
Database Access Entity Framework Core integration
Authentication ASP.NET Core Identity + JWT support
Validation Model validation with Data Annotations or FluentValidation
Logging Built-in logging framework, Serilog integration
Performance Handle thousands of concurrent users
Scalability Stateless design, easy to scale horizontally
Deployment Docker, Azure, AWS, on-premises—deploy anywhere
🎯 Real-World Success

ASP.NET Core powers applications at Stack Overflow, Bing, GoDaddy, and thousands of enterprise systems. It's proven at massive scale.

Comparison with Other Frameworks

Framework Language Performance Type Safety Ecosystem
ASP.NET Core C# ⭐⭐⭐⭐⭐ Strong Excellent
Node.js/Express JavaScript ⭐⭐⭐ Weak (TypeScript helps) Massive
Spring Boot Java ⭐⭐⭐⭐ Strong Excellent
Django Python ⭐⭐⭐ Weak Good
Ruby on Rails Ruby ⭐⭐ Weak Good

Key Takeaways

  • ASP.NET Core is a cross-platform web framework built on .NET
  • It's a complete rewrite of the old ASP.NET Framework
  • Cross-platform: Windows, macOS, Linux
  • High performance: Top-tier in benchmarks
  • Open source: Community-driven on GitHub
  • Build Web APIs, MVC apps, Razor Pages, Blazor, and more
  • Built-in DI: Dependency injection out of the box
  • Middleware pipeline: Flexible request processing
  • Cloud-ready: Designed for modern deployment
  • Perfect for InvenTrack: RESTful API with EF Core, Identity, and more
  • Powers enterprise applications at massive scale
🎯 Next Steps

Now that you understand what ASP.NET Core is and why it's powerful, it's time to get hands-on! In the next section, we'll create your first web application— a simple API that responds to HTTP requests. You'll see the entire development workflow from creation to running your first web service!