ASP.NET Core in Action
Andrew Lock
  • MEAP began February 2017
  • Publication in Spring 2018 (estimated)
  • ISBN 9781617294617
  • 750 pages (estimated)
  • printed in black & white

ASP.NET Core is a re-imagining of the .NET Framework that frees developers from Visual Studio and Windows. You can now build and run cross-platform .NET applications on any OS, with any IDE, and using the tools that you choose. The entire framework is open-source, and has been developed with many contributions from the community. While ASP.NET Core is relatively new, Microsoft is heavily investing in it, promoting ASP.NET Core as their web framework of choice for the foreseeable future. Whether you are building traditional web applications or highly performant APIs for client side or mobile applications, ASP.NET Core could be the framework for you.

ASP.NET Core in Action is for C# developers without any web development experience who want to get started and productive using ASP.NET Core to build web applications. In the first half of the book, you will work through the basics of a typical ASP.NET Core application, focusing on how to create basic web pages and APIs using MVC controllers and the Razor templating engine. In the second half, you will build on this core knowledge looking at more advanced requirements and how to add extra features to your application. You will learn how to secure your application behind a login screen, how to handle configuration and dependency injection, and how to deploy your application to production. In the last part of the book you will look in depth at further bending the framework to your will by creating custom components and using more advanced features of the framework.

"If you're going to learn any ASP.NET Core, then this is the best resource available."

~ Jonathan Wood

"A wonderfully comprehensive book that quickly guides you from novice to proficient. Awesome illustrations and code examples..."

~ Wilke,

"I would highly recommend this book for both ASP.NET veterans and web development newcomers alike."

~ Matthew Groves

"Highly focused... a must-read if you want to get serious on ASP.NET Core."

~ Emanuele Origgi

Table of Contents detailed table of contents

Part 1: Getting Started with MVC

1. Getting Started with ASP.NET Core

1.1. An introduction to ASP.NET Core

1.1.1. Using a web framework

1.1.2. The benefits and limitations of ASP.NET

1.1.3. What is ASP.NET Core?

1.2. When to choose ASP.NET Core

1.2.1. What type of applications can you build?

1.2.2. If you're new to .NET development

1.2.3. If you're a .NET Framework developer creating a new application

1.2.4. Converting an existing ASP.NET application to ASP.NET Core

1.3. How does ASP.NET Core work?

1.3.1. How does an HTTP web request work?

1.3.2. How does ASP.NET Core process a request?

1.4. Choosing a platform for ASP.NET Core

1.4.1. Advantages of using the .NET Framework

1.4.2. Advantages of using .NET Core

1.5. Preparing your development environment

1.5.1. If you're a Windows user

1.5.2. If you're a Linux or macOS user

1.6. Summary

2. Your first application

2.1. A brief overview of an ASP.NET Core application

2.2. Creating your first ASP.NET Core application

2.2.1. Using a template to get started

2.2.2. Building the application

2.3. Running the web application

2.4. Understanding the project layout

2.5. The Program class � building a web host

2.6. The Startup class - configuring your application

2.6.1. Configuring application settings

2.6.2. Adding and configuring services

2.6.3. Defining how requests are handled with middleware

2.7. MVC middleware and the Home Controller

2.8. Generating HTML with Razor template Views

2.9. Summary

3. Handling requests with the Middleware pipeline

3.1. What is middleware?

3.2. Combining middleware in a pipeline

3.2.1. Simple pipeline scenario 1: A holding page

3.2.2. Simple pipeline scenario 2: Handling static files

3.2.3. Simple pipeline scenario 3: An MVC web application

3.3. Handling errors using middleware

3.3.1. Viewing exceptions in development: the DeveloperExceptionPage

3.3.2. Handling exceptions in production: the ExceptionHandlerMiddleware

3.3.3. Handling other errors: the StatusCodePagesMiddleware

3.3.4. Disabling error handling middleware for web APIs

3.4. Summary

4. Creating web pages with MVC Controllers

4.1. An introduction to MVC

4.1.1. The MVC design pattern

4.1.2. MVC in ASP.NET Core

4.1.3. Adding the MvcMiddleware to your application

4.1.4. What makes a controller a controller?

4.2. MVC Controllers and action methods

4.2.1. Accepting parameters to action methods

4.2.2. Using ActionResults

4.3. Summary

5. Mapping URLs to methods using conventional routing

5.1. What is routing?

5.2. Routing to MVC controllers and actions

5.3. Routing using conventions

5.3.1. Understanding route templates

5.3.2. Using optional and default values

5.3.3. Adding additional constraints to route parameters

5.3.4. Defining default values and constraints using anonymous objects

5.3.5. Matching arbitrary URLs with the catch-all parameter

5.4. Handling multiple matching actions for a route

5.5. Generating URLs from route parameters

5.5.1. Generating URLs based on an action name

5.5.2. Generating URLs based on a route name

5.5.3. Generating URLs with ActionResults

5.6. Summary

6. The binding model: retrieving and validating user input

6.1. Understanding the M in MVC

6.2. From request to model: making the request useful

6.2.1. Binding simple types

6.2.2. Binding complex types

6.2.3. Choosing a binding source

6.3. Handling user input with model validation

6.3.1. The need for validation

6.3.2. Using DataAnnotations attributes for validation

6.3.3. Validating on the server for safety

6.3.4. Validating on the client for user experience

6.4. Summary

7. Rendering HTML using Razor views

7.1. Views: Rendering the user interface in MVC

7.2. Creating Razor views

7.2.1. Selecting a view from a controller

7.2.2. Introducing Razor templates

7.2.3. Passing data to views

7.3. Creating dynamic web pages with Razor

7.3.1. Using C# in Razor templates

7.3.2. Adding loops and conditionals to Razor templates

7.3.3. Rendering HTML with Raw

7.4. Layouts, partial views and _ViewStart

7.4.1. Using layouts for shared markup

7.4.2. Overriding parent layouts using sections

7.4.3. Using partial views to encapsulate markup

7.4.4. Running code on every view with _ViewStart and _ViewImports

7.5. Summary

8. Building forms with Tag Helpers

8.1. Catering to editors with Tag Helpers

8.2. Creating forms using Tag Helpers

8.2.1. The Form Tag Helper

8.2.2. The Label Tag Helper

8.2.3. The Input and Textarea Tag Helpers

8.2.4. The Select Tag Helper

8.2.5. The Validation Message and Validation Summary Tag Helpers

8.4. Cache-busting with the Append Version Tag Helper

8.5. Using conditional markup with the Environment Tag Helper

8.6. Summary

9. Creating a Web API for mobile and client applications using MVC

Part 2: Building complete applications

10. Service configuration with dependency injection

11. Service configuration with dependency injection

12. Saving data with Entity Framework Core

13. The MVC Filter Pipeline

14. Adding users to your application with identity and authentication

15. Authorization: securing your application

16. Deploying your application

Part 3: Extending your application

17. Improving your application’s security

18. Building Custom Components

19. Dependency Injection in depth

20. Handling complex deployment requirements

21. Testing your application

Appendixes

Appendix A: .NET Core vs .NET Framework

Appendix B: Bookmarks for more information

What's inside

  • Using MVC to deliver dynamically generated web pages
  • Securing applications with login requirements
  • Interacting with a RDMS using Entity Framework Core
  • Publishing an ASP.NET Core application to a server
  • Unit and integration testing
  • Creating custom middleware and filters

About the reader

Readers should have experience with C#. No web development experience needed.

About the author

Andrew Lock graduated with an Engineering degree from Cambridge University, specializing in Software Engineering, and went on to obtain a PhD in Digital Image Processing. He has been developing professionally with .NET for the last 7 years. His focus is currently on the new ASP.NET Core framework. Andrew currently has a very active blog at https://andrewlock.net dedicated to ASP.NET Core.

Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
Buy
MEAP combo $49.99 pBook + eBook
MEAP eBook $39.99 pdf + ePub + kindle

FREE domestic shipping on three or more pBooks