万本电子书0元读

万本电子书0元读

顶部广告

Mastering ASP.NET Web API电子书

售       价:¥

6人正在读 | 0人评论 9.8

作       者:Mithun Pattankar,Malendra Hurbuns

出  版  社:Packt Publishing

出版时间:2017-08-11

字       数:32.9万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Leverage ASP.Net Web API to build professional web services and create powerful applications. About This Book ? Get a comprehensive analysis of the latest specification of ASP.NET Core and all the changes to the underlying platform that you need to know to make the most of the web API ? See an advanced coverage of ASP.NET Core Web API to create robust models for your data, create controllers, and handle routing and security ? This book is packed with key theoretical and practical concepts that can be instantly applied to build professional applications using API with Angular 4, Ionic, and React Who This Book Is For This book is for .Net developers who wants to Master ASP.NET Core (Web API) and have played around with previous ASP.NET Web API a little, but don’t have in-depth knowledge of it. You need to know Visual Studio and C#, and have some HTML, CSS, and JavaScript knowledge. What You Will Learn ? Acquire conceptual and hands-on knowledge of ASP.NET Core (MVC & Web API) ? Learn about HTTP methods, the structure of HTTP content, internet media types, and how servers respond to HTTP requests and their associated HTTP codes ? Explore middleware, filters, routing, and unit testing ? Optimize Web API implementations ? Develop a secure Web API interface ? Deploy Web API projects to various platforms ? Consume your web API in front end application based on Angular 4, Bootstrap, and Ionic ? Implement and explore the current trends in service architecture In Detail Microsoft has unified their main web development platforms. This unification will help develop web applications using various pieces of the ASP.NET platform that can be deployed on both Windows and LINUX. With ASP.NET Core (Web API), it will become easier than ever to build secure HTTP services that can be used from any client. Mastering ASP.NET Web API starts with the building blocks of the ASP.NET Core, then gradually moves on to implementing various HTTP routing strategies in the Web API. We then focus on the key components of building applications that employ the Web API, such as Kestrel, Middleware, Filters, Logging, Security, and Entity Framework.Readers will be introduced to take the TDD approach to write test cases along with the new Visual Studio 2017 live unit testing feature. They will also be introduced to integrate with the database using ORMs. Finally, we explore how the Web API can be consumed in a browser as well as by mobile applications by utilizing Angular 4, Ionic and ReactJS. By the end of this book, you will be able to apply best practices to develop complex Web API, consume them in frontend applications and deploy these applications to a modern hosting infrastructure. Style and approach Using a hands-on approach, we cover both the conceptual as well as the technical aspects of the ASP.NET Core (Web API) framework.
目录展开

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

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部