Latest Posts On Code Maze

Continuous Deployment from GitHub to Azure App Service

Continuous Deployment from GitHub to Azure App Service

We learned about Azure App Service and how to deploy our ASP.NET Core application into it from Visual Studio in the Publishing an ASP.NET Core App to Azure App Service Using Visual Studio article. In this article, we are going to learn how to configure Continuous...

Using Access Token with Blazor WebAssembly HttpClient

Using Access Token with Blazor WebAssembly HttpClient

In this article, we are going to learn how to use generated Access Token with Blazor WebAssembly to gain access to the protected resources on the Web API's side. Until now, we have integrated the Blazor WebAssembly app with IdentityServer4 and enabled login and logout...

How to Secure Blazor WebAssembly with IdentityServer4

How to Secure Blazor WebAssembly with IdentityServer4

Blazor WebAssembly runs on the client and thus, it can't be trusted. This means that just like with any JavaScript application, the authorization part can be bypassed. So, this means that we have to implement our authorization actions outside of the Blazor WebAssembly...

How to Publish Angular with ASP.NET Core

How to Publish Angular with ASP.NET Core

In this article, we are going to cover how to develop and publish Angular with an ASP.NET Core backend. Single-Page Application (SPA) frameworks like Angular can be configured with ASP.NET Core to facilitate the development and publishing process. This is particularly...

MediatR and CQRS in ASP.NET Core: Complete Guide

MediatR and CQRS in ASP.NET Core: Complete Guide

MediatR is a small .NET library that routes a request object to exactly one handler class, which is what makes it the usual way to implement CQRS in ASP.NET Core: commands and queries become separate request types with separate handlers, and controllers stop knowing...

User Secrets vs Environment Variables in ASP.NET Core

User Secrets vs Environment Variables in ASP.NET Core

ASP.NET Core gives us two ways to keep secrets out of source control on a development machine: user secrets, stored per project in a file outside the repository, and environment variables, stored per machine or per shell session. Both feed straight into...

Custom Configuration Provider in ASP.NET Core With EF Core

Custom Configuration Provider in ASP.NET Core With EF Core

A configuration provider is the piece of ASP.NET Core that turns one source of settings (a JSON file, environment variables, a database) into flat key-value pairs the rest of the app reads through IConfiguration. A custom one is two small classes: an...

ASP.NET Core Configuration Providers

ASP.NET Core Configuration Providers

A configuration provider is one source of settings. JSON files, environment variables, command-line arguments, a key vault, a database table: each is a provider, and each contributes key-value pairs to the single dictionary the application reads through...

Options Validation in ASP.NET Core

Options Validation in ASP.NET Core

Options validation turns a bad configuration value into a clear failure instead of a strange bug three layers down. ASP.NET Core offers three ways to write the rules and one way to decide when they run. The rules go on the options class as data annotations, in a...

Options Pattern in ASP.NET Core With IOptions

Options Pattern in ASP.NET Core With IOptions

The options pattern binds a section of configuration to a class and hands that class to whatever needs it through dependency injection. Instead of asking IConfiguration for "Pages:HomePage:Color", a service asks for IOptions<TitleConfiguration> and reads .Color....

How to Use IConfiguration in ASP.NET Core

How to Use IConfiguration in ASP.NET Core

ASP.NET Core configuration is a single flat dictionary of string keys and string values, assembled at startup from several sources and read through one interface, IConfiguration. Nested JSON becomes flat keys joined by colons, so Logging:LogLevel:Default reaches the...

Dependency Injection in ASP.NET Core

Dependency Injection in ASP.NET Core

In this article, we're going to talk about dependency injection, one of the most frequently used design patterns out there. There are many tutorials about dependency injection, but in this one, we're going to focus on understanding why the dependency injection is used...