
Real-World Web Development with .NET 10
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
Using .NET for web development is a powerful way to build professional-grade websites and services. But moving from a basic project to a full-scale, production-ready system takes more than just business logic and views-it requires a deep understanding of architecture, maintainability, and scalability. Real-World Web Development with .NET 10 bridges that gap, guiding developers who want to build robust, secure, and maintainable web solutions using battle-tested .NET technologies. You'll start by designing structured websites using ASP.NET Core MVC, separating concerns, managing dependencies, and writing clean, testable code. From there, you'll build RESTful services with Web API and use OData for rich, queryable endpoints. The book walks you through testing strategies and containerizing your applications. The final section introduces Umbraco CMS, showing you how to integrate content management into your site so end users can manage content independently. By the end of the book, you'll be ready to build controller-based websites and services that are scalable, secure, and ready for real-world use while mastering Umbraco's flexible, content-driven solutions-skills that are increasingly in demand across organizations and industries. *Email sign-up and proof of purchase required
All prices
More details
Content
- Cover
- Title Page
- Copyrght Page
- Contributors
- Table of Contents
- Preface
- Chapter 1: Introducing Real-World Web Development Using .NET
- Introducing this book and its siblings
- Free Benefits with Your Book
- Understanding ASP.NET Core
- A brief history of ASP.NET Core
- Classic ASP.NET versus modern ASP.NET Core
- Building websites using ASP.NET Core
- Comparison of file types used in ASP.NET Core
- Building websites using a content management system
- Building web applications using SPA frameworks
- Building web and other services
- Cloud providers and deployment tools
- Making good use of the GitHub repository for this book
- Understanding the solution code on GitHub
- Downloading the solution code from the GitHub repository
- Cloning the book solution code repository
- Structuring projects and managing packages
- Structuring projects in a solution
- Structuring folders in a project
- Folder structure based on technological concerns
- Folder structure based on features
- Folder structure summary
- Central package management
- Features and benefits of CPM
- Defining project properties to reuse version numbers
- Configuring CPM for this book's projects
- CPM good practice
- Package source mapping
- Treating warnings as errors
- Building an entity model for use in the rest of the book
- Northwind database SQL scripts
- Installing Docker and an SQL Server container image
- Running the SQL Server container image
- Running a container using the user interface
- Connecting to SQL Server in a Docker container
- Connecting from Visual Studio
- Connecting from VS Code
- Creating the Northwind database using a SQL script
- Removing Docker resources
- Setting up the EF Core CLI tool
- Creating a class library for entity models
- Creating a class library for a database context
- Setting the user and password for SQL Server authentication
- Registering dependency services
- Improving the class-to-table mapping
- Testing the class libraries using xUnit
- Looking for help
- Microsoft Learn documentation and its MCP server
- Getting help on Discord and other chat forums
- Using future versions of .NET with this book
- Understanding web development
- Understanding the Hypertext Transfer Protocol
- Understanding the components of a URL
- Using Google Chrome to make HTTP requests
- Understanding client-side web development technologies
- Practicing and exploring
- Exercise 1.1 - Online material
- Exercise 1.2 - Practice exercises
- How is this website so fast!?
- Troubleshooting web development
- Exercise 1.3 - Test your knowledge
- Know your webbreviations
- Exercise 1.4 - Explore topics
- Summary
- Chapter 2: Building Websites Using ASP.NET Core MVC
- Setting up an ASP.NET Core MVC website
- Example of an HTTP request processing
- Creating an ASP.NET Core MVC website
- Creating the authentication database for SQL Server LocalDB
- Changing the port numbers and starting the website
- Understanding browser requests during development
- Exploring visitor registration
- Reviewing an MVC website project structure
- Reviewing the ASP.NET Core Identity database
- Installing SQLiteStudio
- Configuring files included in an ASP.NET Core project
- Project file build actions
- Exploring an ASP.NET Core MVC website
- ASP.NET Core MVC initialization
- What does MapStaticAssets do?
- What does UseMigrationsEndPoint do?
- Controlling the hosting environment
- The default MVC route
- Controllers and actions
- The responsibilities of a controller
- Routing to controllers
- The ControllerBase class
- The Controller class
- Reviewing the project template controller
- The view search path convention
- Logging using the dependency service
- Using entity and view models
- View model example
- Complex object models
- Implementing views
- How cache busting with Tag Helpers works
- Customizing an ASP.NET Core MVC website
- Defining a custom style
- Setting up the category images
- Razor syntax and expressions
- Defining a typed view
- Testing the home page with categories
- Designing controllers and action methods
- Organize by resource, not by verb
- Limit the number of action methods per controller
- Cross-functional filters
- Using a filter to define a custom route
- Temporarily storing data
- Example request using ViewData
- Example request using TempData
- Separating configuration and hosting
- Separating using extension methods
- Practicing and exploring
- Exercise 2.1 - Online material
- Exercise 2.2 - Practice exercises
- Practice unit testing MVC controllers
- Exercise 2.3 - Test your knowledge
- Exercise 2.4 - Explore topics
- Summary
- Chapter 3: Model Binding, Validation, and Data Using EF Core
- Model binding and validation
- How model binding works
- How validation rules are defined
- Passing parameters using a route value
- Model binders in detail
- Disambiguating action methods
- Passing a route parameter
- Passing a form parameter
- Avoiding over-posting, a.k.a. mass assignment attacks
- Returning HTTP error status codes
- BadRequest
- NotFound
- Unauthorized
- Forbid
- Conflict
- UnprocessableEntity
- StatusCode
- Problem
- ValidationProblem
- Modifying data using EF Core and ASP.NET Core
- Displaying Northwind suppliers
- Inserting, updating, and deleting suppliers
- Manually trying to insert, update, and delete data
- Protecting against CSRF attacks
- How CSRF attacks work
- How anti-forgery tokens prevent CSRF
- How to use Html.AntiForgeryToken()
- Querying a database and using display templates
- Method spoofing
- Improving scalability using asynchronous tasks
- Tasks on a web server
- Making controller action methods asynchronous
- Practicing and exploring
- Exercise 3.1 - Online material
- Exercise 3.2 - Practice exercises
- Practice implementing MVC by implementing a category detail page
- Exercise 3.3 - Test your knowledge
- Exercise 3.4 - Explore topics
- Summary
- Chapter 4: Building and Localizing Web User Interfaces
- Defining web user interfaces with Razor Views
- Using shared layouts with Razor Views
- Defining views with HTML Helper methods
- Defining web user interfaces with Tag Helpers
- Comparing HTML Helpers and Tag Helpers
- Exploring the Anchor Tag Helper
- Exploring the Cache Tag Helpers
- Exploring the Environment Tag Helper
- Exploring Forms-related Tag Helpers
- Trying out the form
- Localizing web user interfaces with ASP.NET Core
- Working with cultures
- Localizing your user interface
- Web user interface localization
- Creating resource files
- If you are using Visual Studio
- If you are using VS Code
- Other resource file tools
- Managing resource files
- Localizing Razor Views with an injected view localizer
- Understanding the Accept-Language header
- Prototyping with Bootstrap
- Breakpoints and containers
- Rows and columns
- Color themes
- Tables
- Buttons and links
- Badges
- Alerts
- Should you use Bootstrap?
- Practicing and exploring
- Exercise 4.1 - Online material
- Exercise 4.2 - Practice exercises
- Practice creating a custom Tag Helper
- Practice building UIs with Bootstrap
- Exercise 4.3 - Test your knowledge
- Exercise 4.4 - Explore topics
- Summary
- Chapter 5: Authentication and Authorization
- Introducing authentication and authorization
- Key concepts of authentication and authorization
- Identity management
- Authentication schemes
- Role-based and claims-based authorization
- Security best practices
- Cookie-based authentication
- Password verifier good practices
- Implementing authentication and authorization
- Defining policies
- External authentication
- Securing APIs with JWT
- Securing controller action methods using filters
- Enabling role management and creating a role programmatically
- Cross-functional filters
- Authorization filter (IAuthorizationFilter)
- Resource filter (IResourceFilter)
- Action filter (IActionFilter)
- Exception filter (IExceptionFilter)
- Result filter (IResultFilter)
- Common benefits of all filters
- Practicing and exploring
- Exercise 5.1 - Online material
- Exercise 5.2 - Practice exercises
- Auth0 integration
- Exercise 5.3 - Test your knowledge
- Exercise 5.4 - Explore topics
- Summary
- Chapter 6: Performance and Scalability Optimization Using Caching
- Introducing caching with ASP.NET Core
- General caching guidelines
- Cache invalidation
- Reviewing types of caching
- Caching HTTP responses for websites
- Common Cache-Control directives
- Controlling Cache-Control directives in ASP.NET Core
- Exploring Cache-Control directives
- Seeing the effect of Cache-Control directives
- Summary of caching types
- Output caching
- Output caching endpoints
- Output caching MVC views
- Varying output cached data by query string
- Disabling output caching to avoid confusion
- Object caching
- Caching objects using in-memory caching
- Expirations for in-memory caching
- Exploring in-memory object caching
- Caching objects using distributed caching
- Hybrid object caching
- Creating data repositories with caching for entities
- Enabling hybrid caching in the MVC project
- Adding a class library to implement a data repository
- Configuring the customer repository
- Clearing Chrome's address bar autocomplete
- Designing for case sensitivity
- More techniques to improve scalability
- Horizontal scaling with load balancing
- Asynchronous programming
- Database optimizations
- Message queues and background services
- Auto-scaling in the cloud
- CDN
- Health checks and monitoring
- Practicing and exploring
- Exercise 6.1 - Online material
- Exercise 6.2 - Practice exercises
- Practicing improving scalability by understanding and implementing async action methods
- Exercise 6.3 - Test your knowledge
- Exercise 6.4 - Explore topics
- Summary
- Chapter 7: Web User Interface Testing Using Playwright
- Introducing web user interface testing
- Types of web UI testing
- What should you test in a web UI?
- Challenges and good practices with web UI testing
- The roles of developers and testers
- Developers and web UI testing
- Testers and web UI testing
- Collaboration between developers and testers
- Real-life applications of web user interface testing
- E-commerce websites: preventing cart and checkout failures
- Financial applications: ensuring data integrity and accuracy
- Healthcare portals: guaranteeing user and data safety
- Banking applications: avoiding security and transaction errors
- Government and public sector: ensuring accessibility compliance
- SaaS platforms: preventing downtime and data loss
- Travel and booking platforms: ensuring smooth transactions
- Testing web user interfaces using Playwright
- Modern browser components
- The modern browser stack
- Key browser engines and projects
- Chromium versus Blink
- WebKit and Safari
- What can Playwright do?
- Benefits for .NET developers
- Playwright and alternatives
- Selenium
- Puppeteer
- Playwright
- Common Playwright testing types
- Common Playwright testing methods
- Common Playwright locator methods
- Common Playwright locator automation methods
- Disposing of Playwright objects
- Why not IDisposable?
- Recommended patterns
- Anti-patterns to avoid
- Reviewing the website before testing
- Testing page navigation and title verification
- Interacting with a web user interface
- Filling in input boxes and clicking elements
- Form submission, authentication, and validation
- Responsive design testing
- Emulating screen sizes
- Emulating devices
- Emulating locale, time zone, and geolocation
- Emulating dark mode and color schemes
- Customizing the user agent, disabling JavaScript, and going offline
- SPAs and dynamic content
- Generating tests with the Playwright Inspector
- Practicing and exploring
- Exercise 7.1 - Online-only material
- Exercise 7.2 - Practice exercises
- Exercise 7.3 - Test your knowledge
- Exercise 7.4 - Explore topics
- Summary
- Chapter 8: Configuring and Containerizing ASP.NET Core Projects
- Configuring dependency services
- Introducing dependency injection
- Why use DI?
- Injection mechanisms of DI in .NET
- Examples in modern .NET
- Constructor injection example
- Property injection example
- Method injection example
- Dependency graphs and service resolution
- Registering dependency service lifetimes
- When are exceptions thrown?
- Registering services for features using extension methods
- When you cannot use constructor injection
- Using scoped services in middleware
- Resolving services at startup
- DI and MVC controller action methods
- DI and MVC views
- Disposing of services
- Best practices for DI
- Configuring the HTTP pipeline
- Understanding endpoint routing
- Benefits of endpoint routing
- Reviewing the default endpoint routing configuration
- Common methods for registering dependencies
- Common methods for registering middleware
- Configuring endpoint routing
- Setting up the HTTP pipeline
- Visualizing the HTTP pipeline
- Implementing an anonymous inline delegate as middleware
- Configuring options
- Configuration sources
- Configuration classes and interfaces
- How to manually set up configuration
- Understanding IConfiguration and IConfigurationRoot
- IConfiguration for combined settings from all providers
- IConfigurationRoot for more advanced scenarios
- Showing providers and settings
- Trying out the configuration web page
- Showing specific settings
- Configuration overriding in production deployments
- Configuration overriding in Docker
- Configuration overriding in Kubernetes
- Loading configuration using the Options pattern
- Using IOptionsSnapshot and IOptionsMonitor
- Configuration validation
- Using custom configuration providers
- Containerizing ASP.NET Core projects
- How containers work and their benefits
- Docker and Aspire
- Installing Docker and using prebuilt images
- Aspire for orchestrating projects
- Aspire project types
- Aspire resource types
- Developer dashboard for monitoring
- Aspire support
- Code editor and CLI support for Aspire
- Starting an Aspire solution
- Aspire application model and orchestration
- Aspire project templates
- Exploring the Aspire starter template
- Exploring the Aspire starter solution
- AppHost project for orchestrating resources
- ServiceDefaults project for centralized configuration
- Participating functional projects
- Aspire integrations
- Logging, tracing, and metrics for observability
- Docker versus Podman for containers
- Waiting for containers to be ready
- Adding Aspire to your existing .NET apps
- Deployment with Aspire
- Understanding Aspire manifests
- Aspire cloud deployments
- Aspir8 deployment YAML files
- Practicing and exploring
- Exercise 8.1 - Online material
- Exercise 8.2 - Practice exercises
- Using Podman
- Aspireify
- Exercise 8.3 - Test your knowledge
- Exercise 8.4 - Explore topics
- Summary
- Chapter 9: Building Web Services Using ASP.NET Core Web API
- Introducing web services
- Aspects of RESTful services
- Statelessness
- Resource-based
- Uniform interface
- Client-server architecture
- Cacheability
- Layering
- Representation of resources
- Idempotency
- Hypermedia as the Engine of Application State (HATEOAS)
- Why REST matters
- Understanding HTTP versions
- HTTP/0.9 (1991)
- HTTP/1.0 (1996)
- HTTP/1.1 (1997, updated in 1999)
- HTTP/2 (2015)
- HTTP/3 (2020)
- Understanding HTTP requests and responses for web APIs
- GET requests
- Common response status codes
- Caching requests example
- POST, PUT, and other requests and common responses
- Creating an ASP.NET Core Web API with controllers project
- Reviewing an ASP.NET Core Web API with controllers project
- Trying out the weather forecast web service's functionality
- Setting the new Description property in .NET 10
- Minimal API web service and native AOT compilation
- A non-benefit of Minimal API
- Creating a web service for the Northwind database
- Integrating the Northwind entity model and enabling XML responses
- Controlling XML serialization
- Routing web service requests to action methods
- Route constraints
- Understanding action method return types
- Configuring the customer repository and Web API controller
- Specifying problem details
- Documenting and trying out web services
- Making GET requests using a browser
- Making GET requests using HTTP/REST tools
- Making other requests using HTTP/REST tools
- Passing environment variables
- Visual Studio Endpoints Explorer
- Documenting web services with Swagger, OpenAPI, and Swashbuckle
- Implementing the OpenAPI Specification
- Support for OpenAPI 3.1
- Generate OpenAPI documents in YAML format
- Generating clients using an OpenAPI specification
- Implementing Scalar
- Caching responses and logging
- Caching HTTP responses for web services
- Enabling HTTP logging
- Logging to the Windows-only Event Log
- Support for logging additional request headers in W3CLogger
- Logging and security principles
- Avoid logging sensitive information
- Mask or obfuscate sensitive data
- Avoid logging request and response bodies for sensitive endpoints
- Use structured logging for sensitive data management
- Log security events without sensitive data
- Beware of third-party library logging
- Log errors with caution
- Practicing and exploring
- Exercise 9.1 - Online material
- Implementing advanced features for web services
- Improved route tooling
- Exercise 9.2 - Practice exercise
- Exercise 9.3 - Test your knowledge
- Exercise 9.4 - Explore topics
- Summary
- Chapter 10: Building Clients for Web Services
- Consuming web services using HTTP clients
- Understanding HttpClient
- Configuring HTTP clients using HttpClientFactory
- Getting customers as JSON in the controller
- Getting distinct country names
- Implementing an MVC action method for calling the web service
- Starting multiple projects
- If you are using Visual Studio and want to start projects manually
- If you are using Visual Studio and want to start projects automatically
- If you are using VS Code
- Starting the web service and MVC client projects
- Consuming web services using Refit
- Relaxing the same-origin security policy using CORS
- Understanding the same-origin policy in web browsers
- Configuring HTTP logging for the web service
- Trying out the JavaScript call to the web service
- Understanding CORS
- Understanding other CORS policy options
- Understanding identity services
- JWT bearer authorization
- Authenticating service clients using JWT bearer authentication
- Trying out the token
- JWT in production
- Common identity providers
- Configuring authentication with an identity provider
- Registering with an identity provider
- Principles of Web API design
- Use resource-oriented URIs
- HTTP methods semantics
- Response status codes
- Versioning web services
- Resource nesting
- Filtering, sorting, and paging
- Request and response shapes
- Hypermedia as the Engine of Application State (HATEOAS)
- Error handling and standard errors
- Authentication and authorization
- Design summary
- Implementing URI versioning
- Adding versions to the customers web service
- Trying out the versioning
- Updating clients to use versioning
- Manual versioning without a package
- Practicing and exploring
- Exercise 10.1 - Online material
- Exercise 10.2 - Practice exercise
- Creating and deleting customers with HttpClient
- Exercise 10.3 - Test your knowledge
- Exercise 10.4 - Explore topics
- Summary
- Chapter 11: Testing and Debugging Web Services
- Introducing all types of testing
- Unit testing
- Integration, end-to-end, and security testing
- Performance, load, and stress testing
- Functional and usability testing
- Testing terminology
- Attributes of all good tests
- Test outcomes
- Test doubles, mocks, and stubs
- Adopting a testing mindset
- Basics of integration testing
- Which external systems to test
- Sharing fixtures in integration tests
- Understanding web service functional and end-to-end testing
- End-to-end test scenario
- Functional test scenario
- Test automation
- Integration testing with data stores
- Developer instances of the database and migrations
- Data lifecycle
- Improvements to integration testing of apps with top-level statements
- Testing web services using xUnit
- Unit testing using xUnit
- Common xUnit attributes
- Web service hosting with WebApplicationFactory
- Enabling an ASP.NET Core 9 and earlier project to be tested
- Creating the test project
- Mocking in tests
- Libraries for mocking
- Using NSubstitute to create test doubles
- Mocking with NSubstitute example
- Creating a class library to mock
- Creating a test project with mocking
- Debugging web services using dev tunnels
- Installing the dev tunnel CLI
- Exploring a dev tunnel with the CLI and an echo service
- Exploring a dev tunnel with an ASP.NET Core project
- Configuring a dev tunnel in Visual Studio
- Disabling dev tunnels
- Dev tunnels summary
- Practicing and exploring
- Exercise 11.1 - Online-only material
- Exercise 11.2 - Practice exercises
- Create integration tests for three web service technologies
- Exercise 11.3 - Test your knowledge
- Exercise 11.4 - Explore topics
- Summary
- Chapter 12: Building Web Services Using ASP.NET Core OData
- Understanding OData
- Understanding the OData standard
- Benefits of OData
- Standardized querying
- Cross-platform interoperability and integration with the Microsoft ecosystem
- Self-describing and rich metadata
- Supports RESTful principles and CRUD operations
- Supports multiple data formats
- Built-in support for data relationships
- Extensibility
- Standard security features
- Disadvantages of OData
- Building a web service that supports OData
- Defining OData models for the EF Core models
- Defining OData models in the project
- Testing the OData models
- Creating and testing OData controllers
- Exploring OData services using HTTP/REST tools
- Creating an HTTP file for making requests
- Understanding OData queries
- OData standard query options
- OData operators
- OData functions
- Exploring OData queries
- Using logs to review the efficiency of OData requests
- Implementing versions and data modifications
- Versioning OData controllers
- Matching HTTP requests to controller action methods
- Routing conventions
- Method signatures
- Delta and partial updates
- Overriding OData routing conventions with attribute routing
- Enabling entity inserts, updates, and deletes
- Building clients for OData services
- Calling services in the Northwind MVC website
- Trying out the OData client
- LINQ to OData
- Installing LINQ to OData in a client project
- Generating typed classes for LINQ to OData
- Querying with LINQ to OData
- Revisiting the introductory query
- Practicing and exploring
- Exercise 12.1 - Online material
- Exercise 12.2 - Practice exercises
- Exercise 12.3 - Test your knowledge
- Exercise 12.4 - Explore topics
- Summary
- Chapter 13: Building Web Services Using FastEndpoints
- Introducing FastEndpoints
- Pros and cons of FastEndpoints
- What makes it "fast"?
- Introducing the REPR pattern
- Request
- Endpoint
- Processor
- Response
- How REPR differs from controllers
- How to define an endpoint
- Example FastEndpoints endpoint implementation
- Implementing FastEndpoints
- Adding FastEndpoints to an empty ASP.NET Core project
- Enabling FastEndpoints and defining endpoints
- Trying out the FastEndpoints web service
- Configuring FastEndpoints
- Configuration methods and properties
- Mapping requests and responses to entity models
- Validating with FluentValidation
- Trying out creating, updating, and deleting
- FastEndpoint versioning
- Practicing and exploring
- Exercise 13.1 - Online material
- Exercise 13.2 - Practice exercises
- Exercise 13.3 - Test your knowledge
- Exercise 13.4 - Explore topics
- Summary
- Chapter 14: Web Content Management Using Umbraco CMS
- Understanding the benefits of a CMS
- Reviewing basic CMS features
- Reviewing enterprise CMS features
- Reviewing CMS platforms
- Winning against WordPress
- Introducing Umbraco CMS
- Why is Umbraco popular?
- Umbraco versions
- Installing Umbraco CMS
- Creating a new Umbraco project
- Initializing a new Umbraco project
- Exploring Umbraco back office
- Setting up languages
- Unattended installs
- Defining document types
- Example document types
- Creating a document type for the home page
- Defining a document template
- Reviewing the website
- Adding a home page as content
- Configuring the French variant home page
- Working with media
- Good media practices
- Organizing media using folders
- Using tags to enhance searchability
- Optimizing image sizes before uploading
- Using meaningful filenames and alt text
- Leveraging image cropping and variants
- Avoiding duplicate media uploads
- Removing unused media regularly
- Using Umbraco's built-in permissions for media access
- Training editors on best practices and providing resources
- Uploading images to Umbraco CMS
- Structuring and navigating hierarchical content
- Generating a navigation menu from structure
- Creating a document type for standard pages
- Adding standard pages as content
- Creating a Razor Partial View for navigation
- Practicing and exploring
- Exercise 14.1 - Online material
- Exercise 14.2 - Practice exercises
- Exercise 14.3 - Test your knowledge
- Exercise 14.4 - Explore topics
- Summary
- Chapter 15: Customizing and Extending Umbraco CMS
- Techniques for customizing and extending Umbraco
- Building custom property editors for enhanced content creation
- Integrating third-party APIs to enhance functionality
- Custom workflow automation for content approval
- Multilingual capabilities with custom language switching
- Customizing Umbraco behavior using settings
- Content settings
- Security settings
- Imaging settings
- Global settings
- Content version cleanup
- Working with views and Razor syntax
- What is IPublishedContent?
- Core functionality of IPublishedContent
- Using IPublishedContent with ModelsBuilder
- Rendering fields in a strongly typed view
- Rendering complex field types
- Rendering Rich Text Editor (RTE) fields
- Rendering MNTP fields
- Handling Media Picker fields
- Handling Nested Content and Block List editors
- Common considerations
- Accessing member data
- Using Models Builder
- The UmbracoHelper class
- Retrieving content by ID
- Retrieving media by ID
- Rendering a content template
- Getting dictionary values
- Querying content using LINQ
- Checking member authorization
- UmbracoHelper summary
- Headless mode with Delivery API
- Rebuilding the indexes
- Consuming content via Delivery API
- Filtering and querying content
- Handling media via API
- Practicing and exploring
- Exercise 15.1 - Online material
- Exercise 15.2 - Practice exercises
- The Starter Kit
- Extending Umbraco
- Exercise 15.3 - Test your knowledge
- Exercise 15.4 - Explore topics
- Summary
- Epilogue
- Next steps on your web development learning journey
- Companion books to continue your learning journey
- Other books to take your learning further
- The next edition
- Good luck!
- Appendix A: Answers to the Test Your Knowledge Questions
- Chapter 1 - Introducing Real-World Web Development Using .NET
- Chapter 2 - Building Websites Using ASP.NET Core MVC
- Chapter 3 - Model Binding, Validation, and Data Using EF Core
- Chapter 4 - Building and Localizing Web User Interfaces
- Chapter 5 - Authentication and Authorization
- Chapter 6 - Performance and Scalability Optimization Using Caching
- Chapter 7 - Web User Interface Testing Using Playwright
- Chapter 8 - Configuring and Containerizing ASP.NET Core Projects
- Chapter 9 - Building Web Services Using ASP.NET Core Web API
- Chapter 10 - Building Clients for Web Services
- Chapter 11 - Testing and Debugging Web Services
- Chapter 12 - Building Web Services Using ASP.NET Core OData
- Chapter 13 - Building Web Services Using FastEndpoints
- Chapter 14 - Web Content Management Using Umbraco CMS
- Chapter 15 - Customizing and Extending Umbraco CMS
- Appendix B: Setting Up Your Development Environment
- Installing Visual Studio, VS Code, or Rider
- Choosing between code editors
- Visual Studio for general development on Windows
- VS Code for cross-platform development
- GitHub Codespaces for development in the cloud
- What I used
- Downloading and installing Visual Studio on Windows
- Keyboard shortcuts for Visual Studio
- Downloading and installing VS Code
- Installing other extensions
- Scripting the installation of extensions
- Keyboard shortcuts for VS Code
- Downloading and installing Rider
- Installing Docker and an SQL Server container image
- Using an existing SQL Server container
- Installing Docker Desktop
- Running the SQL Server container image
- Running a container using the user interface
- Connecting to a SQL Server database
- Connecting to SQL Server in a Docker container
- Connecting from Visual Studio
- Connecting from VS Code
- Northwind database SQL scripts
- Creating the Northwind database using a SQL script
- Removing Docker resources
- Installing and setting up SQL Server locally
- Installing SQL Server Developer Edition for Windows
- VS Code extension for working with SQL Server
- Creating the Northwind sample database locally
- Setting up Azure SQL Database
- Creating an Azure resource group
- Creating an Azure SQL Server and SQL Database
- Getting the Azure SQL Database connection string
- Creating the Northwind sample database in the cloud
- Rider tool window for working with SQL Server
- Appendix C: Looking For Help
- Microsoft Learn documentation
- Microsoft Learn documentation MCP server
- Documentation links in my books
- Getting help from the dotnet tool
- Getting definitions of types and their members
- Configuring inline aka inlay hints
- Searching for answers using Google
- Getting help on Discord and other chat forums
- Searching the .NET source code
- Source code in documentation
- Official .NET blog, standups, and news
- Watching Scott Hanselman's videos
- AI tools like ChatGPT and GitHub Copilot
- ChatGPT example
- GitHub Copilot for programmers
- Customizing Copilot responses
- Disabling tools when they get in the way
- Unlock Your Exclusive Benefits
- Index
- Blank Page
1
Introducing Real-World Web Development Using .NET
This book is about mature and proven web development with .NET. This means a set of technologies that have been refined over a decade or more with plenty of documentation, support forums, and third-party investment. These technologies are:
- .NET: A free, open-source developer platform from Microsoft for building and running cross-platform apps, including web, desktop, mobile, cloud, and games, using languages like C#, F#, and Visual Basic.
- ASP.NET Core: A set of shared components for building websites and services using .NET. This book covers a subset of its features, including the following:
- ASP.NET Core MVC: An implementation of the model-view-controller design pattern for complex yet well-structured website development
- ASP.NET Core Web API: For building controller-based web services that conform to the HTTP/REST service architecture conventions
- ASP.NET Core OData: For building data access web services using an open standard
- FastEndpoints: A third-party web service platform built on ASP.NET Core.
- Umbraco CMS: A third-party, open-source, content management system (CMS) platform built on ASP.NET Core.
With these technologies, you will learn how to build cross-platform websites and web services using .NET 10.
A benefit of choosing .NET 10 is that it is a Long-Term Support (LTS) release, meaning it is supported for three years. .NET 10 was released in November 2025, and it will reach its end of life in November 2028. After .NET 11 is released in November 2026, you can target it, but be aware that it is a Standard Term Support (STS) release, and it will reach its end of life in November 2028, on the same day as .NET 10. You can learn more about STS 24-month support durations at the following link:
https://devblogs.microsoft.com/dotnet/dotnet-sts-releases-supported-for-24-months/.
Usually, the benefits of choosing the latest .NET version are performance improvements and better support for containerization in cloud hosting compared to earlier versions.
Throughout this book, I use the term modern .NET to refer to .NET 10 and its predecessors, like .NET 6, that derive from .NET Core. I use the term legacy .NET to refer to .NET Framework, Mono, Xamarin, and .NET Standard. Modern .NET is a unification of those legacy platforms and standards.
Who are you? While writing this book, I have assumed that you are a .NET developer who is employed by a consultancy or a large organization. As such, you primarily work with mature and proven technologies like MVC rather than the newest shiny technologies pushed by Microsoft like Blazor. I also assume that you have little professional interest in being a web designer or content editor. You are much more concerned with how well a software product works rather than looks.
I assume you have already set up your development environment to use Visual Studio 2026, Visual Studio Code, or JetBrains Rider. Throughout this book, I will use the names Visual Studio, VS Code, and Rider to refer to these three code editors, respectively. If you have not set up your development environment, then you can learn how to in Appendix B, Setting Up Your Development Environment, or at the following link:
https://github.com/markjprice/web-dev-net10/blob/main/docs/ch01-setup-dev-env.md.
Warning! Prerequisites for this book are knowledge of C# and .NET fundamentals, including how to build .NET projects with a tool like Visual Studio or the dotnet command-line interface (CLI). You can learn these skills from my book, C# 14 and .NET 10 - Modern Cross-Platform Development Fundamentals.
I recommend that you work through this and subsequent chapters sequentially because later chapters will reference projects in earlier chapters, and you will build up sufficient knowledge and skills to tackle the more challenging problems in later chapters. For example, a section in this chapter will walk you through creating a pair of class libraries that define a database entity model that will be used in subsequent chapters.
In this chapter, we will cover the following topics:
- Introducing this book and its siblings
- Understanding ASP.NET Core
- Making good use of the GitHub repository for this book
- Structuring projects and managing packages
- Building an entity model for use in the rest of the book
- Looking for help
- Using future versions of .NET with this book
- Understanding web development
Free Benefits with Your Book
Your purchase includes a free PDF copy of this book (containing Appendix A, B, and C), along with other exclusive benefits. Check the Free Benefits with Your Book section in the Preface to unlock them instantly and maximize your learning experience.
Introducing this book and its siblings
Before we dive in, let's set the context by understanding that this is one of four books about .NET 10 that I have written that cover almost everything a beginner to .NET needs to know.
This book is the second of a quartet of books that completes your learning journey through .NET 10:
- The first book, C# 14 and .NET 10 - Modern Cross-Platform Development Fundamentals, covers the fundamentals of the C# language, the .NET libraries, and using modern ASP.NET Core, Blazor, and Minimal API web services for web development. It is designed to be read linearly because skills and knowledge from earlier chapters build up and are needed to understand later chapters.
- The second book (the one you're reading now), Real-World Web Development with .NET 10, covers mature and proven web development technologies like ASP.NET Core MVC and controller-based Web API web services, as well as OData, FastEndpoints, and Umbraco CMS for building real-world web projects on .NET 10. You will learn how to test your web services using xUnit and test the user interfaces of your websites using Playwright, and then how to containerize your projects ready for deployment.
- The third book, Apps and Services with .NET 10, covers data using SQL Server, Dapper, and EF Core, as well as more specialized .NET libraries like internationalization and popular third-party packages including Serilog and Noda Time. You will learn how to build native ahead-of-time (AOT)-compiled services with ASP.NET Core Minimal API web services and how to improve performance, scalability, and reliability using caching, queues, and background services. You will implement modern services using GraphQL, gRPC, and SignalR. Finally, you will learn how to build graphical user interfaces for websites, desktop, and mobile apps with .NET MAUI, Avalonia, and Blazor.
- The fourth book, Tools and Skills for .NET 10, covers important tools and skills that a professional .NET developer should have. These include design patterns and solution architecture, debugging, memory analysis, all the important types of testing, whether it be unit, integration, performance, or web user interface testing, and then topics for testing cloud-native solutions on your local computer, like containerization, Docker, and Aspire. Finally, we will look at how to prepare for an interview to get the .NET developer career that you want.
A summary of the .NET 10 quartet and their most important topics is shown in Figure 1.1:
Figure 1.1: Companion books for learning .NET for beginner-to-intermediate readers
Now, let's review some of the history of web development using .NET, which means learning about one of its most important platforms, ASP.NET Core.
Understanding ASP.NET Core
To understand ASP.NET Core, it is useful to first see where it came from.
A brief history of ASP.NET Core
ASP.NET Core is part of a 30-year history of Microsoft technologies used to build websites and services that work with data that have evolved over the decades:
- ActiveX Data Objects (ADO) was released in 1996 and was Microsoft's attempt to provide a single set of Component Object Model (COM) components for working with data. With the release of .NET Framework in 2002, an equivalent was created named ADO.NET, which is still today the fastest method to work with data in .NET with its core classes,...
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.
File format: ePUB
Copy protection: without DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Use a reader that can handle the file format ePUB, such as Adobe Digital Editions or FBReader – both free (see eBook Help).
- Tablet/Smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePUB works well for novels and non-fiction books – i.e., 'flowing' text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook does not use copy protection or Digital Rights Management
For more information, see our eBook Help page.