My name is Carl. I am a software engineer and architect. I blog about C#, .NET, Javascript, AngularJS, nodejs, and more. Thanks for visiting!



Buy me a coffeeBuy me a coffee

Tags

A New Year A New Blog Framework

This post is a little different from others. Instead of a tutorial or highlighting a specific technology, I'm going to talk about how I migrated my blog, this website, from AngularJS to client-side web assembly Blazor with .NET 6. This website started at the end of 2017. At the time, I was doing a lot of AngularJS development and thought it would be good experience to start a project from scratch to really learn the framework. Fast forward 5 years (I can't believe it's been 5 years already!) and AngularJS is no longer officially supported and other web technologies have emerged. Additionally, Blazor now runs in the browser using web assembly and .NET 6 has been released. I thought it was time to move this website to something different and wanted to learn Blazor. What follows is the summary of my website rewrite project.

Read More...


Use Azure AD to Authorize Access to Azure Blob Storage

In this post, I show you how to enable authorization to Azure Blob Storage using IAM on a storage account. At the end of this post, you will understand how to leverage Azure Active Directory App Registrations, Identity Access Management, RBAC, and the C# Azure identity and storage APIs to securely access Azure blob storage containers and data.

Read More...


Use Azure AD and Microsoft Graph API to Manage Files in OneDrive

In this post, I describe how to authenticate to OneDrive using any Azure AD account or personal Microsoft account and upload and download files. At the end of this post, you will have an understanding of how to leverage Azure, Microsoft Identity, the Microsoft Graph API, and OneDrive for storage in your application. This post requires a Microsoft account and OneDrive subscription. The free one will work. It also requires an Azure subscription with permissions to modify Active Directory. I have not been charged yet with this example but Azure costs may apply depending on usage.

Read More...


Azure B2C authentication with API and SPA

In this post, I configure an Azure B2C tenant and show how to authenticate a user through a single page application to connect to endpoints in a custom API application. By the end, you will have a working demo of an authenticated user interacting with authorized API endpoints through a SPA using Azure B2C. The single page application contains a breakout-inspired game that tracks users' scores using a custom API. An Azure subscription is required but, at the time of this post, creating an azure B2C tenant is free up to a certain number of active users.

Read More...


Example of the Strategy Pattern

In this post I explain the strategy design pattern and show an example of applying it to import data from different data sources. The strategy pattern is a behavioral design pattern that allows different implementations to be used interchangably at runtime. An application can select the appropriate method to perform a task. The example application lets the user import music data from a csv file source or json file source. Depending on the file type, the import strategy is chosen.

Read More...


Create Custom User Store for ASP .NET Core Identity - .NET Core 3 Update

This post is an update to my previous post on how to create a custom user store in dotnet core 2. It contains updated code for working with dotnet core 3.x, the Visual Studio 2019 MVC project template, and updated screenshots. The end result is the same, an in-memory user store to plug into the ASP .NET Core Identity system.

Read More...


Create Custom Password Hasher for ASP .NET Core Identity - .NET Core 3 Update

This post is an update to my previous post on how to create a custom password hasher in dotnet core 2. It contains updated code for working with dotnet core 3.x, the Visual Studio 2019 MVC project template, and updated screenshots. The end result is the same, a custom password hasher to plug into the ASP .NET Core Identity system.

Read More...


The Outbox Pattern in C#

In this post, I explain the outbox pattern and implement an example in C#. The outbox pattern can be used when one business transaction needs to happen as a result of another business transaction but it's not possible to combine them into the same database transaction. The example contains two applications. The first allows a user to add titles and authors of books. After a new book is added, a row is created in the outbox. The second application processes the entries in the outbox. The example requires .NET Core 2.1 and SQL Server 2017 express.

Read More...


Create Formatted Text Files With csvhelper

In this post, I will show some examples for reading and writing text files using csvhelper. Csvhelper is a simple and fast library primarily used for writing csv files. Additionally, it can be configured to use any character as a delimiter. It is available via NuGet. I have used csvhelper in a number of projects for data export features or saving preferences, etc.

Read More...


Create Custom User Store for ASP .NET Core Identity - Deprecated

In this post, I will look at how to extend the ASP .NET Core Identity membership system to use a custom user store. This will store users in memory and not a database. This would not be useful in a production application because the list of users resets every time the application is started. However, by customizing ASP .NET Core Identity, we gain a better understanding of the components and how they fit together. This tutorial requires Visual Studio 2017 and dotnet core 2.0.

Read More...


Create Custom Password Hasher for ASP .NET Core Identity - Deprecated

In this post, I will look at how to extend the ASP .NET Core Identity membership system to use a custom class for hashing passwords. ASP .NET Core Identity is very extendable and extending it is a good way to get a better understanding of how the system works. We can customize it by providing new implementations to its interfaces. As with any custom security implementation, customization should be done with care and be backed by good reasons. That being said, lets have some fun. This tutorial requires Visual Studio 2017, dotnet core 2.0, and LocalDb.

Read More...


ASP .NET Core MVC Dependency Injection Overview

ASP .NET Core MVC comes with dependency injection built in and the options available will cover most use cases. In this post I will summarize what is available and how to configure and use it. This post does not explain the concept of dependency injection or why it is a helpful practice to follow but how it is integrated into the ASP .NET Core MVC framework.

Read More...


Using C# dynamic Keyword To Replace Data Transfer Objects

For this post I'm going to show 3 examples of using the C# dynamic keyword when deserializing input data instead of using data transfer objects. Many modern applications need to accept data from a variety of sources. Often times we create data transfer objects just to handle requests and responses to and from the data source. Using dynamic in C# reduces the need for data transfer objects and keeps the logic that depends on the 3rd party data source contained to one place.

Read More...



© 2025 Carl Layton Creative Commons License Disclaimer
An unhandled error has occurred. Reload 🗙