售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Title Page
Copyright
Mastering ASP.NET Web API
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Why subscribe?
Customer Feedback
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
Introduction to Microservices and Service-Oriented Architecture
Services in SOA
Service implementation
Monolithic architecture
Overheads of Monolithic architecture
Introducing Microservices
Lightweight yet scalable
Technology agnostic
Independently changeable
Benefits of Microservices
Summary
Understanding HTTP and REST
Software architecture
REST principles
Client - server
Stateless
Cache
The uniform interface
Layered system
Code-on-demand
REST architectural elements
Data elements
Resources and resource identifiers
Representations
Connectors
Components
HTTP
HTTP/1.1 status codes
An API example
HTTP POST example
HTTP GET example
HTTP PUT example
HTTP DELETE example
Version 2 of HTTP
Single connection
Server push
Multiplexing and streams
Stream prioritization
Binary messages
Header compression
Media types
Richardson maturity model
Level 0
Level 1
Level 2
Level 3
Summary
Anatomy of ASP.NET Core Web API
A quick recap of the MVC framework
Inception of Web APIs and their evolution
Introducing web API
ASP.NET into Open Source world
Introduction to .NET Core
Install .NET Core SDK
Creating and running a basic .NET Core application
Introducing ASP.NET Core
An overview of ASP.NET Core
Creating ASP.NET Core Project using Visual Studio IDE
Choosing the application type
Selecting authentication type
Creating ASP.NET Core web applications on Linux/macOS
Creating ASP.NET Core web apps with Yeoman
Creating ASP.NET Core Web API using Yeoman
ASP.NET Core Web API Application structure
Program.cs
Startup.cs
The Configure method
The ConfigureServices method
*.csproj
ASP.NET Core request processing
Unified MVC and Web API in ASP.NET Core
Running the ASP.NET Core Web API project
Running the application in Visual Studio IDE
Running ASP.NET Core Web API on Linux/macOS
Further reading
Summary
Controllers, Actions, and Models
Introduction to controllers
Actions
Post
Get
Put
Patch
Delete
Controllers
Models
Business
Dependency Injection
GET by ID
Mapping
Post
Put
Delete
GetAll
Summary
Implementing Routing
Introducing Routing
Routing middleware
The RouteBuilder class
MapRoute
ASP.NET Core Web API and Routing
Convention-based Routing
Template-based Routing
Attribute-based Routing
Attribute routes for RESTful applications
Multiple Routes
Routing constraints
Types of route constraints
Writing custom route constraints
Link generation
Routing best practices
Summary
Middleware and Filters
Introducing middleware
HTTP request pipeline and middleware
Middleware in action
Use()
Run()
Map()
MapWhen()
Order of middleware
Built-in middleware
Using StaticFiles middleware
Writing custom middleware
Migrating HTTP modules to middleware
Introducing filters
Filter pipeline
Filter scoping
Action filters
Authorization filter
Exception filter
Summary
Perform Unit and Integration Testing
Uncle Bob's three rules of test-driven development
Red-Green-Refactor
Running the API test
The Post Created test
Setting the base URI
The Post Conflict test
The Put tests
The Delete tests
The xUnit tests
The Models tests
The validator class
API Test
Summary
Web API Security
Understanding Threat Model and OWASP
Threat Model
OWASP
Applying SSL
CORS
Data Protection API
Protecting web API
Implementing JWT
Generating JWTs
Validating JWT
OAuth
Claims-based Authorizations
Authorization using the claims policy
Identity management in web API
Adding the Identity package
Configuring the Startup class
Creating identity-related database
Cookie-based authentication
Two-factor authentication
Summary
Integration with Database
Brief introduction to Object Relational Mapper
Integrating ASP.NET Core Web API and an existing database using Entity Framework 6.x
Restoring the AdventureWorks2014 database
EF6 data access library
Creating an ASP.NET Core app for the full .NET Framework
Using IProductRepository to access the database
Connection strings and IProductRepository in startup
Using AutoMapper
Writing ProductController to access the database
Integrating using Dapper
Creating AdvWrksDapper Web API and adding Dapper library
Using IDepartmentRepository and department model to access the database
Connection string and IOptions in ASP.NET Core
Adding the DeparmentController Web API
Integrating with EF Core
Creating PacktContactsCore ASP.NET Core project
Adding the EF Core package and tooling
Contacts model class and DbContext
Configuring services to use the SQL Server database
EF tools for database migrations and updates
ContactsController for CRUD operations
Summary
Error Handling, Tracing, and Logging
Basics of Logging in ASP.NET Core
Logging level
Logging in action
Logging category
ILoggerFactory in dependency injection
MyWallet - Demo ASP.NET Core project
Logging errors to a file using NLog
Logging errors to a database using Serilog
Exception management in a MyWallet project
Links to log management services
Summary
Optimization and Performance
Measuring application performance
Asynchronous controller action methods
HTTP compression
Adding response compression middleware
Implementing in-memory caching
Working with distributed caching
Using an SQL Server distributed cache
Response caching
Summary
Hosting and Deployment
Creating a demo ASP.NET Core Web API project
Publishing ASP.NET Core Web API project
Publishing by CLI
Publishing by Visual Studio Tooling
Standalone web API
Deployment strategy
Deploying web API to IIS
Configuring a website on IIS
Deploying a web API to Azure App Service
Publishing a web API to Windows virtual machine on Azure
Publishing a web API to Docker
Publishing a web API to EC2 on AWS
Publishing a web API to Linux
Testing PacktContacts web API
Test case - Accessing a web API without the header
Test case - Accessing a web API with the header
Test case - Adding a contact to web API
Test case - Getting a contact from the web API
Test case - Getting all contacts from the web API
Test case - Editing a contact to the web API
Test case - Deleting a contact from the web API
Summary
Modern Web Frontends
PacktContacts - Recap of the demo web API project
Dealing with a cross-origin issue
Software pre-requisites for web frameworks
Consuming web APIs using Angular 4
Angular CLI
PacktServices - Angular Service Provider
AppComponent - Angular Component
The AppComponent template - HTML for Angular component
Building hybrid mobile apps using Ionic 3
Home page - Ionic 3 page
Home page - Ionic 3 HTML page
Building web apps using ReactJS
ReactJS in ASP.NET web application
Consuming web APIs using JavaScript
Consuming web APIs using JQuery
Summary
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜