For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Download from Wow! eBook <www.wowebook.com>
v
Contents at a Glance
About the Authors �������������������������������������������������������������������������������������������������������������� xix
About the Technical Reviewer ������������������������������������������������������������������������������������������� xxi
Acknowledgments ����������������������������������������������������������������������������������������������������������� xxiii
Introduction ���������������������������������������������������������������������������������������������������������������������� xxv
Chapter 1: Introduction to ASP�NET Web API ■ ���������������������������������������������������������������������1
Chapter 2: Introduction to Asynchronous Programming in �NET ■ �������������������������������������27
Chapter 3: HTTP, REST, and Hypermedia ■ ��������������������������������������������������������������������������57
Chapter 4: HttpClient ■ �������������������������������������������������������������������������������������������������������75
Chapter 5: Sample Application: Application Structure and Domain Model ■ ���������������������95
Chapter 6: Sample Application: Building the Web API ■ ���������������������������������������������������141
Chapter 7: Sample Application: Building the Wrapper and Web Client ■ �������������������������197
Chapter 8: Routing ■ ���������������������������������������������������������������������������������������������������������215
Chapter 9: Controllers and Actions ■ ��������������������������������������������������������������������������������231
Chapter 10: Message Handlers ■ ��������������������������������������������������������������������������������������275
Chapter 11: Filters ■ ���������������������������������������������������������������������������������������������������������289
Chapter 12: Media Type Formatters and Model Binding ■ �����������������������������������������������325
Chapter 13: Input Validation ■ ������������������������������������������������������������������������������������������365
Chapter 14: Dependency Resolution ■ ������������������������������������������������������������������������������415
Chapter 15: Unit Testing and Integration Testing ■ ����������������������������������������������������������431
■ Contents at a GlanCe
vi
Chapter 16: Optimization and Performance ■ ������������������������������������������������������������������463
Chapter 17: Hosting ■ �������������������������������������������������������������������������������������������������������517
Chapter 18: Tracing, Logging, and API Documentation ■ �������������������������������������������������545
Index ���������������������������������������������������������������������������������������������������������������������������������577
xxv
If you would like to discover the possibilities oered by HTTP on the .NET Framework, ASP.NET Web API is the
technology for you. is book will get you up to speed on how it works and how to use it at both high and low levels.
We have structured this book to make it really easy to use. If you would like to get your hands dirty quickly,
we recommend that you work through Chapters 1 to 7 in order, because Chapters 5, 6, and 7 are all about building
a sample multitier application using ASP.NET Web API. is sample application is intended as a guide on how to
structure an ASP.NET Web API application in a hosting-agnostic way (from both API and client perspectives). We
recommend you download the source code and run the application locally to begin with. You can download the
source code from www.apress.com/9781430247258 along with all the other code related to this book. Alternatively,
you can get it from GitHub (https://github.com/tugberkugurlu/PingYourPackage) through a Git client (make sure to
check out the “Edition-1” branch). No matter which method you choose, be sure to read the “Run the Application” section
inside the README.md le (https://github.com/tugberkugurlu/PingYourPackage/blob/Edition-1/README.md)
to get the sample application running smoothly.
If you prefer to get into the core of the ASP.NET Web API framework, you can choose to skip the sample
application chapters and go straight to the feature-specic chapters on routing, controllers, message handlers, lters,
and so on. ese chapters really dive into the details of the specic parts of the ASP.NET Web API request pipeline and
will give you a deep understanding of how the framework is processing your request.
Required Software
To use this book, you will need:
.NET Framework 4.5 or higher•
Visual Studio 2012 or later•
Visual Studio Extension: NuGet Package Manager •
Visual Studio Extension: xUnit.net runner for Visual Studio•
SQL Server Express (for sample applications and some other samples)•
Any other software we make use of in the book is available through NuGet.
Introduction
- 1
- 2
前往页