Thoughts on .Net & Coding
.Net Articles, tutorials, reviews, code and more...
-
Perform custom validation in Blazor
Validating form data is one of the most common task in any web application. ASP.NET Core offers a set of validation attributes for performing model level data validations. Blazor apps can also make use of the same validation attributes. Some of the validation attributes include [Required], [StringLength], [Range], and [Compare]. At times you want to perform some validation not covered by these attributes. This is when you want to create a custom validation attribute. In this article we will discuss how that can be done.
-
Use keyed services in AspNet Core
A few years ago I wrote an article describing how ASP.NET Core DI container behaves when multiple implementations of an interface are registered. It's time to revisit the concept because .NET 8 has something better to offer -- Keyed Services. I am going to use the same example that I used in the earlier article. We will modify the example for .NET 8.
-
Store connection string in Azure App Service and Azure Key Vault
In the previous article you learned to deploy an ASP.NET Cor web app in an Azure App Service using two techniques. Recollect that we are storing the database connection string in the appsettings.json file. And we need to change it to match the production setup at the time of deployment. In this article we will discuss two better ways of storing the database connection string. Firstly, we will learn to store the connection string into the Azure App Service itself. And then we will store it in Azure Key Vault.
-
Use IExceptionHandler to handle errors in AspNet Core
No matter how carefully you design your web pages and components there is always a possibility that your application throws an error at runtime. To trap and handle such unforeseen circumstances you can use IExceptionHandler interface introduced in ASP.NET Core 8.
https://www.binaryintellect.net/articles/3f87c933-2e21-4df4-9c26-8f350afc68da.aspx -
Use access token and refresh token returned by Identity API endpoints
In the previous part of this series we wired token based authentication and Identity API endpoints into our Employees Web API. Now it's time to test and confirm the working of our API.
-
Use token authentication and Identity API endpoints in AspNet Core
If you are following previous articles of this series, you are probably comfortable working with Web API and class library projects in VS Code. We will take our example a step further and add authentication to the Web API.
-
Work with Web API and Class Library projects in Visual Studio Code
In the previous article you learned to setup Visual Studio Code for ASP.NET Core development. We created ASP.NET Core MVC project and used scaffolding to create CRUD pages. In this article you will create a Web API that exposes the CRUD functionality to its client apps. You will also wrap the EF Core code inside a class library project.
-
Develop ASP.NET Core apps using Visual Studio Code
Visual Studio Code or VS Code is a light weight IDE for modern web development. It supports a wide range of programming and scripting languages including C# and .NET Core. It has a very good extensions and libraries. If you are an ASP.NET developer familiar with Visual Studio and are looking to get introduced to Visual Studio Code this article is for you.
-
Display tabular data using QuickGrid for Blazor
Displaying tables or grids is one of the most common requirements in web applications. There are plenty of third-party grid components available for ASP.NET Core and Blazor. However, if you require basic tabular display with sorting, paging, and filtering abilities QuickGrid component developed by the Blazor team is all you need. In this article we will explore some of the features and abilities of QuickGrid.
-
Use API key authentication in ASP.NET Core
Developers often need to authenticate Web API calls at two levels. You might want to authenticate individual users while making an API call or you might want to authenticate the client that is trying to call an API. The former is can be implemented via a token based scheme and latter can be implemented using what is known an API key authentication.