Ever since .NET Core 1.0 was introduced, the whole .NET ecosystem seems to have been given a new life. The framework was revitalized and now with the version 3, it has become a force to be reckoned with.
Not many technologies have achieved this level of polish, stability, maturity and speed. Creating a flexible yet stable technology is quite a feat, and that’s exactly what ASP.NET Core developers have achieved.
On top of that, REST APIs have become a defacto standard in the industry because of their ability to decouple backend and frontend parts of the application and the ability to serve thousands of clients simultaniously.
Docker is one of the greatest innovations that happened in the last few years. It has opened new horizons in software development and it spun off many innovative solutions and projects. Docker images and containers are rapidly becoming THE way to do software development.
Our main goal will be to show off the tremendous power of Docker and ASP.NET Core when combined.
PROJECT CONFIGURATION
- Creating a New Project
- launchSettingsjson File Configuration
- Programcs and Startupcs Explanations
- Extension Methods and CORS Configuration
- IIS Configuration
- Additional Code in the Startup Class
- Environment-Based Settings
CONFIGURING A LOGGING SERVICE
- Creating the Required Projects
- Creating the ILoggerManager Interface and Installing NLog
- Implementing the Interface and NlogConfig File
- Configuring Logger Service for Logging Messages
- DI, IoC, and Logger Service Testing
DATABASE MODEL AND REPOSITORY PATTERN
- Creating Models
- Context Class and the Database Connection
- Migration and Initial Data Seed
- Repository Pattern Logic
- Repository User Interfaces and Classes
HANDLING GET REQUESTS
- Controllers and Routing in WEB API
- Naming Our Resources
- Getting All Companies From the Database
- Testing the Result with Postman
- DTO Classes vs Entity Model Classes
- Using AutoMapper in ASPNET Core
GLOBAL ERROR HANDLING
- Handling Errors Globally with the Built-In Middleware
- Startup Class Modification
- Testing the Result
GETTING ADDITIONAL RESOURCES
- Getting a Single Resource From the Database
- Parent/Child Relationships in Web API
- Getting a Single Employee for Company
CONTENT NEGOTIATION
- What Do We Get Out of the Box?
- Changing the Default Configuration of Our Project
- Testing Content Negotiation
- Restricting Media Types
- More About Formatters
- Implementing a Custom Formatter
METHOD SAFETY AND METHOD IDEMPOTENCY
CREATING RESOURCES
- Handling POST Requests
- Code Explanation
- Creating a Child Resource
- Creating Children Resources Together with a Parent
- Creating a Collection of Resources
- Model Binding in API
WORKING WITH DELETE REQUESTS
- Deleting a Parent Resource with its Children
WORKING WITH PUT REQUESTS
- Updating Employee
- Inserting Resources while Updating One
WORKING WITH PATCH REQUESTS
- Applying PATCH to the Employee Entity
VALIDATION
- Validation while Creating Resource
- Validation for PUT Requests
- Validation for PATCH Requests
What is Asynchronous Programming?
- Async, Await Keywords, and Return Types
- Modifying the ICompanyRepository Interface and the CompanyRepository Class
- IRepositoryManager and RepositoryManager Changes
- Controller Modification
ACTION FILTERS
- Action Filters Implementation
- The Scope of Action Filters
- Order of Invocation
- Improving the Code with Action Filters
- Validation with Action Filters
- Dependency Injection in Action Filters
PAGING
- What is Paging?
- Paging Implementation
- Concrete Query
- Improving the Solution
FILTERING
- What is Filtering?
- How is Filtering Different from Searching? How to Implement Filtering in ASPNET Core Web API
- Sending and Testing a Query
SEARCHING
- What is Searching?
- Implementing Searching in Our Application
- Testing Our Implementation
SORTING
- What is Sorting?
- How to Implement Sorting in ASPNET Core Web API
- Implementation – Step by Step
- Testing Our Implementation
- Improving the Sorting Functionality
DATA SHAPING
- What is Data Shaping?
- How to Implement Data Shaping
- Step-by-Step Implementation
- Resolving XML Serialization Problems
SUPPORTING HATEOAS
- What is HATEOAS and Why is it so Important?
- Adding Links in the Project
- Additional Project Changes
- Adding Custom Media Types
- Implementing HATEOAS
WORKING WITH OPTIONS AND HEAD REQUESTS
- OPTIONS HTTP Request
- OPTIONS Implementation
- Head HTTP Request
- HEAD Implementation
ROOT DOCUMENT
- Root Document Implementation
VERSIONING APIS
- Required Package Installation and Configuration
- Versioning Examples
CACHING
- About Caching
- Adding Cache Headers
- Adding Cache-Store
- Expiration Model
- Validation Model
- Supporting Validation
- Using ETag and Validation
RATE LIMITING AND THROTTLING
- Implementing Rate Limiting
JWT AND IDENTITY
- Implementing Identity in ASPNET Core Project
- Creating Tables and Inserting Roles
- User Creation
- Big Picture
- About JWT
- JWT Configuration
- Protecting Endpoints
- Implementing Authentication
- Role-Based Authorization
DOCUMENTING API WITH SWAGGER
- About Swagger
- Swagger Integration Into Our Project
- Adding Authorization Support
- Extending Swagger Configuration
DEPLOYMENT TO IIS
- Creating Publish Files
- Windows Server Hosting Bundle
- Installing IIS
- Configuring Environment File
- Testing Deployed Application
PREPARING THE APPLICATION
- Modifying the launchSetting.json File
- Switching to an In-Memory Database
- Adding a Test Project and a Unit Test
THE DOCKER CLI THROUGH EXAMPLES
- Short Intro to Docker on Windows
Why Docker?
- Scenario One: Using Docker to Keep Local Environments Clean
- Scenario Two: Using Docker to Test Your App in a Clean Environment
- Scenario Three: Persisting the Changes and Cross-Platform Development
DOCKERIZING ASP.NET CORE APP
- Creating a Dockerfile
- Creating a .dockerignore File
- Building the image
- Optimizing Even Further
- Just Run and Test Boys, Run, and Test
- Creating Multistage Builds in Dockerfiles
- Adding a Server Certificate
- Some Useful Commands
MULTI-CONTAINER APPLICATIONS WITH DOCKER COMPOSE
- What is Docker Compose?
- Adding Docker Compose to Our Application.
- Building the Image With Compose
- Adding a MSSQL Database with Docker Compose
DOCKER HUB VS CREATING A LOCAL DOCKER REGISTRY
- Difference Between Docker Repository and Docker Registry
- More About Docker Hub
- Creating a Local Docker Registry
- Pushing Images to a Local Docker Registry.
- Use Cases for the