Ultimate ASP.NET Core Web API, PREMIUM Second Edition
Ultimate ASP.NET Core Web API - Second Edition - SUPER COMPLETE Ebook
EBOOK TABLE OF CONTENTS
1 PROJECT CONFIGURATION
1.1 Creating a New Project
1.2 launchSettings.json File Configuration
1.3 Program.cs Class Explanations
1.4 Extension Methods and CORS Configuration
1.5 IIS Configuration
1.6 Additional Code in the Program Class
1.7 Environment-Based Settings
1.8 ASP.NET Core Middleware
1.8.1 Creating a First Middleware Component
1.8.2 Working with the Use Method
1.8.3 Using the Map and MapWhen Methods
1.8.4 Using MapWhen Method
2 CONFIGURING A LOGGING SERVICE
2.1 Creating the Required Projects
2.2 Creating the ILoggerManager Interface and Installing NLog
2.3 Implementing the Interface and Nlog.Config File
2.4 Configuring Logger Service for Logging Messages
2.5 DI, IoC, and Logger Service Testing
3 ONION ARCHITECTURE IMPLEMENTATION
3.1 About Onion Architecture
3.1.1 Advantages of the Onion Architecture
3.1.2 Flow of Dependencies
3.2 Creating Models
3.3 Context Class and the Database Connection
3.4 Migration and Initial Data Seed
3.5 Repository Pattern Logic
3.6 Repository User Interfaces and Classes
3.7 Creating a Repository Manager
3.8 Adding a Service Layer
3.9 Registering RepositoryContext at a Runtime
4 HANDLING GET REQUESTS
4.1 Controllers and Routing in WEB API
4.2 Naming Our Resources
4.3 Getting All Companies From the Database
4.4 Testing the Result with Postman
4.5 DTO Classes vs. Entity Model Classes
4.6 Using AutoMapper in ASP.NET Core
5 GLOBAL ERROR HANDLING
5.1 Handling Errors Globally with the Built-In Middleware
5.2 Program Class Modification
5.3 Testing the Result
6 GETTING ADDITIONAL RESOURCES
6.1 Getting a Single Resource From the Database
6.1.1 Handling Invalid Requests in a Service Layer
6.2 Parent/Child Relationships in Web API
6.3 Getting a Single Employee for Company
7 CONTENT NEGOTIATION
7.1 What Do We Get Out of the Box?
7.2 Changing the Default Configuration of Our Project
7.3 Testing Content Negotiation
7.4 Restricting Media Types
7.5 More About Formatters
7.6 Implementing a Custom Formatter
8 METHOD SAFETY AND METHOD IDEMPOTENCY
9 CREATING RESOURCES
9.1 Handling POST Requests
9.2 Code Explanation
9.2.1 Validation from the ApiController Attribute
9.3 Creating a Child Resource
9.4 Creating Children Resources Together with a Parent
9.5 Creating a Collection of Resources
9.6 Model Binding in API
10 WORKING WITH DELETE REQUESTS
10.1 Deleting a Parent Resource with its Children
11 WORKING WITH PUT REQUESTS
11.1 Updating Employee
11.1.1 About the Update Method from the RepositoryBase Class
11.2 Inserting Resources while Updating One
12 WORKING WITH PATCH REQUESTS
12.1 Applying PATCH to the Employee Entity
13 VALIDATION
13.1 ModelState, Rerun Validation, and Built-in Attributes
13.1.1 Rerun Validation
13.1.2 Built-in Attributes
13.2 Custom Attributes and IValidatableObject
13.3 Validation while Creating Resource
13.3.1 Validating Int Type
13.4 Validation for PUT Requests
13.5 Validation for PATCH Requests
14 ASYNCHRONOUS CODE
14.1 What is Asynchronous Programming?
14.2 Async, Await Keywords and Return Types
14.2.1 Return Types of the Asynchronous Methods
14.2.2 The IRepositoryBase Interface and the RepositoryBase Class
Explanation
14.3 Modifying the ICompanyRepository Interface and the CompanyRepository Class
14.4 IRepositoryManager and RepositoryManager Changes
14.5 Updating the Service layer
14.6 Controller Modification
14.7 Continuation in Asynchronous Programming
14.8 Common Pitfalls
15 ACTION FILTERS
15.1 Action Filters Implementation
15.2 The Scope of Action Filters
15.3 Order of Invocation
15.4 Improving the Code with Action Filters
15.5 Validation with Action Filters
15.6 Refactoring the Service Layer
16 PAGING
16.1 What is Paging?
16.2 Paging Implementation
16.3 Concrete Query
16.4 Improving the Solution
16.4.1 Additional Advice
17 FILTERING
17.1 What is Filtering?
17.2 How is Filtering Different from Searching?
17.3 How to Implement Filtering in ASP.NET Core Web API
17.4 Sending and Testing a Query
18 SEARCHING
18.1 What is Searching?
18.2 Implementing Searching in Our Application
18.3 Testing Our Implementation
19 SORTING
19.1 What is Sorting?
19.2 How to Implement Sorting in ASP.NET Core Web API
19.3 Implementation – Step by Step
19.4 Testing Our Implementation
19.5 Improving the Sorting Functionality
20 DATA SHAPING
20.1 What is Data Shaping?
20.2 How to Implement Data Shaping
20.3 Step-by-Step Implementation
20.4 Resolving XML Serialization Problems
21 SUPPORTING HATEOAS
21.1 What is HATEOAS and Why is it so Important ?
21.1.1 Typical Response with HATEOAS Implemented
21.1.2 What is a Link?
21.1.3 Pros/Cons of Implementing HATEOAS
21.2 Adding Links in the Project
21.3 Additional Project Changes
21.4 Adding Custom Media Types
21.4.1 Registering Custom Media Types
21.4.2 Implementing a Media Type Validation Filter
21.5 Implementing HATEOAS
22 WORKING WITH OPTIONS AND HEAD REQUESTS
22.1 OPTIONS HTTP Request
22.2 OPTIONS Implementation
22.3 Head HTTP Request
22.4 HEAD Implementation
23 ROOT DOCUMENT
23.1 Root Document Implementation
24 VERSIONING APIS
24.1 Required Package Installation and Configuration
24.2 Versioning Examples
24.2.1 Using Query String
24.2.2 Using URL Versioning
24.2.3 HTTP Header Versioning
24.2.4 Deprecating Versions
24.2.5 Using Conventions
25 CACHING
25.1 About Caching
25.1.1 Cache Types
25.1.2 Response Cache Attribute
25.2 Adding Cache Headers
25.3 Adding Cache-Store
25.4 Expiration Model
25.5 Validation Model
25.6 Supporting Validation
25.6.1 Configuration
25.7 Using ETag and Validation
26 RATE LIMITING AND THROTTLING
26.1 Implementing Rate Limiting
27 JWT, IDENTITY, AND REFRESH TOKEN
27.1 Implementing Identity in ASP.NET Core Project
27.2 Creating Tables and Inserting Roles
27.3 User Creation
27.4 Big Picture
27.5 About JWT
27.6 JWT Configuration
27.7 Protecting Endpoints
27.8 Implementing Authentication
27.9 Role-Based Authorization
28 REFRESH TOKEN
28.1 Why Do We Need a Refresh Token
28.2 Refresh Token Implementation
28.3 Token Controller Implementation
29 BINDING CONFIGURATION AND OPTIONS PATTERN
29.1 Binding Configuration
29.2 Options Pattern
29.2.1 Using IOptions
29.2.2 IOptionsSnapshot and IOptionsMonitor
30 DOCUMENTING API WITH SWAGGER
30.1 About Swagger
30.2 Swagger Integration Into Our Project
30.3 Adding Authorization Support
30.4 Extending Swagger Configuration
31 DEPLOYMENT TO IIS
31.1 Creating Publish Files
31.2 Windows Server Hosting Bundle
31.3 Installing IIS
31.4 Configuring Environment File
31.5 Testing Deployed Application
32 BONUS 1 - RESPONSE PERFORMANCE IMPROVEMENTS
32.1 Adding Response Classes to the Project
32.2 Service Layer Modification
32.3 Controller Modification
32.4 Testing the API Response Flow
33 BONUS 2 - INTRODUCTION TO CQRS AND MEDIATR WITH ASP.NET CORE WEB API
33.1 About CQRS and Mediator Pattern
33.1.1 CQRS
33.1.2 Advantages and Disadvantages of CQRS
33.1.3 Mediator Pattern
33.2 How MediatR facilitates CQRS and Mediator Patterns
33.3 Adding Application Project and Initial Configuration
33.4 Requests with MediatR
33.5 Commands with MediatR
33.5.1 Update Command
33.5.2 Delete Command
33.6 MediatR Notifications
33.7 MediatR Behaviors
33.7.1 Adding Fluent Validation
33.7.2 Creating Decorators with MediatR PipelineBehavior
33.7.3 Validating null Object
Super complete ebook, here is all the information you need, 393 pages