Title Page
Copyright Page
Dedication Page
Contents at a Glance
Table of Contents
Introduction
Who should read this book
Assumptions
This book might not be for you if...
Organization of this book
Finding your best starting point in this book
Conventions and features in this book
System requirements
Downloads: Sample Project
Errata, updates, & book support
Free ebooks from Microsoft Press
We want to hear from you
Stay in touch
Part 1: Alpine Ski House
Chapter 1. How We Got Here
Active Server Pages
ASP.NET
ASP.NET MVC
Web API
ASP.NET Core
Summary
Chapter 2. Influencers
Backward compatibility
Rails
Node.js
Angular and React
Open source
OWIN
Summary
Chapter 3. Models, Views, and Controllers
The M, the V, and the C of it
Diving into Models
Views
Partial Views
Controllers (...and Actions!)
It’s Not Just About MVC
Middleware
Dependency Injection
Other Gems
Summary
Chapter 4. Scoping the Project
Ski Slopes
The API
The Admin View
Pulling the Pieces Together
Defining our Domain
Summary
Chapter 5. Builds
Command Line Builds
Build Servers
The Build Pipeline
Building Alpine Ski House
Summary
Chapter 6. Deployment
Picking a web server
Kestrel
Reverse Proxy
IIS
Nginx
Publishing
Build Types
Building A Package
The Case for Azure
Azure Deployments
Container Deployments
Summary
Part 2: Sprint Retro: A Journey of 1000 Steps
Chapter 7. Building Web Applications with Microsoft Azure
Thinking of Platform as a Service
Platform Services
Scaffolding, Destroying, and Recreating Your Services
Building Applications Using Platform Services
Creating a Storage Account
Storing Images in Blob Containers
Incorporating Storage Queues
Automating Processing with Azure WebJobs
Scaling Out Your Applications
Scaling in Multiple Directions
Scaling with Elasticity
Scaling Considerations
Summary
Chapter 8. Cross-Platform
Up and Running on Ubuntu
Installing .NET Core
The dotnet CLI
Choosing a Code Editor
Alpine Ski House on Linux
.NET Core
Summary
Chapter 9. Containers
Repeatable Environments
Docker
Windows Containers
Docker in Production
On the Cloud
Summary
Chapter 10. Entity Framework Core
Entity Framework Basics
Querying for a single record
Querying for multiple records
Saving Data
Change Tracking
Using Migrations to Create and Update Databases
The ApplicationDbContext
Extending ApplicationUserContext
Ski Card Context
Relationships crossing Context Boundaries
Wiring up the Controller
Pass Types
Passes and Validation
Events and Event Handlers
Summary
Chapter 11. Razor Views
Creating Web Sites as a Developer Today
Building on Previous Successes and Learnings
Understanding Razor’s Role
Mastering Razor Essentials
Peeking Behind the Curtain
Writing Expressions with Razor Syntax
Switching to Code
Explicitly Using Markup
Razor Parser Control Cheat Sheet
Bringing in More C# Features
Using C# Types in Your Views
Defining a Model
Using View Data
Working with Layouts
Foundations of Layouts
Including Sections from Views
Defining and Consuming Partial Views
Enhancing Views with Advanced Razor Functionality
Injecting Services into a View
Working with Tag Helpers
Avoiding Duplication in Your Views
Using Alternate View Engines
Summary
Chapter 12. Configuration and Logging
Moving Away from web.config
Configuring Your Application
Using Stock Configuration Providers
Building a Custom Configuration Provider
Employing the Options Pattern
Logging as a First-Class Citizen
Creating Logs That Provide Clarity
Setting Expectations for Exceptions
Logging as a Development Strategy
Logging Levels in ASP.NET Core
Using Logging Scopes to Augment Logging
Using a Structured Logging Framework
Logging as a Service
Summary
Part 3: Sprint Retro: The Belly of the Beast
Chapter 13. Identity, Security, and Rights Management
Defense in Depth
Internal Threats
External Threats
User Secrets
Azure-Backed Authentication
Identity in ASP.NET Core MVC
Referencing ASP.NET Identity
Local User Accounts
Other Third-Party Authentication Providers
Enabling Security Through Attributes
Using Policies for Authorization
Applying Policies Globally
Defining Policies for Selected Use
Custom Authorization Policies
Protecting Resources
Cross-Origin Resource Sharing (CORS)
Summary
Chapter 14. Dependency Injection
What is Dependency Injection?
Resolving Dependencies Manually
Using a Service Container to Resolve Dependencies
Dependency Injection in ASP.NET Core
Using The Built-In Container
Using a third-party container
Summary
Chapter 15. Role of JavaScript
Writing Good JavaScript
Do We Even Need it?
Organization
To SPA or not to SPA?
Building JavaScript
Bundler & Minifier
Grunt
gulp
WebPack
Which Tool is Right for me?
TypeScript
ES2015 to ES5 Compiler
Typing System
Module Loading
Picking a Framework
Summary
Chapter 16. Dependency Management
NuGet
Installing packages with NuGet
npm
Adding Dependencies
Using npm modules
Visual Studio Integration
Yarn
Bower
Adding Dependencies
Referencing Assets from Bower Packages
Summary
Chapter 17. Front End with Style
Building Websites with Style Sheets
Digging up the Past
Creating Your Own Style Sheet
Getting Sassy with Your Style
Basics of SCSS
Creating Mixins
Mixing Mixins and Directives
Establishing a Development Workflow
Using Command Line Tools
Working in Visual Studio Code
Modifying the Project Build Tasks
Using Third Party Frameworks
Extending a CSS Framework
Customizing a CSS Framework Footprint
Leveraging CSS Frameworks for Custom Style Sheets
Alternatives to CSS Frameworks
Summary
Chapter 18. Caching
Cache Control Headers
Using the Data-Cache
In Memory Cache
Distributed Cache
How Much Cache is Too Much?
Summary
Part 4: Sprint Retro: Home Stretch
Chapter 19. Reusable Components
Tag Helpers
Anatomy of a Tag Helper
Scripts, Links, and Environment Tag Helpers
Cache Tag Helper
Creating Tag Helpers
View Components
Invoking View Components
Contact Customer Service View Component
Partial Views
Summary
Chapter 20. Testing
Unit Testing
XUnit
JavaScript Testing
Other Types of Testing
Summary
Chapter 21. Extensibility
Conventions
Creating Custom Conventions
Middleware
Configuring the pipeline
Writing your own Middleware
Pipeline Branching
Loading External Controller and Views
Loading Views from External Projects
Loading Controllers from External Assemblies
Routing
Attribute Routing
Advanced Routing
Dotnet tools
JavaScript Services and Isomorphic Applications
Isomorphic Applications
Node Services
Summary
Chapter 22. Internationalization
Localizable Text
String Localization
View Localization
Data Annotations
Sharing Resource Files
Setting the Current Culture
Summary
Chapter 23. Refactoring and Improving Code Quality
What is refactoring?
Measuring Quality
Finding Time to Refactor
Refactoring with a Safety Net
Data Driven Changes
A Code Cleanup Example
Tools That Want to Help
Getting to Quality
Summary
Chapter 24. Organizing the Code
Repository Structure
Inside the Source
Parallel Structure
MediatR
A Brief Introduction to the Messaging Pattern
Implementing a Mediator
Areas
Summary
Postfix
Index
About the Authors
Hear about it first
Visit us today
Free ebooks
Survey
Code Snippets