Partially inflated objects
Aug 12, 2021
One thing that I, and many developers I talk to, find annoying is when you receive an object from any API that is partially inflated.
I define a partially inflated object as any object that you receive that has one or more properties not set.
For instance consider an API that returns the following fictitious FunRun class and in particular the AthleteIds property.
public class FunRun { public Guid Id { get; set; } public string Name { get; set; } public Guid[] AthleteIds { get; set; } } The FunRun class represents a particular fun run race, and the Identifiers of the Athletes who are participating in it, e.
...
➦
ASPNET Core appsettings are stored in a dictionary
Nov 18, 2020
Today I learned the ASPNET Core reads appsettings into a key-value pair dictionary. This is outlined in the Hierarchical configuration data section of the Configuration documentation:
The Configuration API is capable of maintaining hierarchical configuration data by flattening the hierarchical data with the use of a delimiter in the configuration keys.
This can be problematic if this isn’t known. For instance consider an array in your appsettings.json:
{ "myproperty": { "myarray": [ { "name": "one" }, { "name": "two" } ] } } This would flatten into:
...
➦
Living under a rock - Powershell Core
Sep 27, 2020
Recently I learnt that there have been many great advances in Powershell in recent years. This post is to highlight some of them to developers who may have also been turning a blind eye.
Powershell CORE exists, and it’s cross platform I’m a bit late to the party with this one - it was announced in 2016. If you didn’t know, now you do, you can get more information on it https://github.
...
➦
AWS Lamda with SQS FIFO as an event source
Jul 14, 2020
In late 2019 AWS announced support for SQS FIFO queues as an event source for AWS Lambdas.
Amazon SQS FIFO (First-In-First-Out) queues Amazon’s Simple Queue Service supports FIFO as per the docs:
FIFO (First-In-First-Out) queues are designed to enhance messaging between applications when the order of operations and events is critical, or where duplicates can’t be tolerated
Message Grouping One of their amazing features SQS FIFO queues is the ability to have sequenced message that are grouped.
...
➦
Finding your hello world
May 20, 2020
I’ve never liked creating Hello World as a way to understand a new technology. Recently I have been employing a new technique of building a small application that I have a passion for.
For me my passion is running, so instead of building Hello World I build a Running Pace Calculator. Below is a mock-up of the funcionality, it is quite simple it that you input your goal time (in hours, minutes and seconds) and the distance and it calculates how fast you would need to run in kilometer splits.
...
➦
Blazor Web Assembly Tips and gotchas
Apr 30, 2020
I have been experimenting with Blazor Web Assembly (WASM) which at the time of writing is in preview for ASP.NET Core 3.1. Here are some quick tips and things to watch out for.
Debugging WASM doesn’t work (in firefox) The team recently shipped Blazor WASM debugging support. I followed the excellent debugging documentation but couldn’t get it to work. The solution was to pay more attention to the documentation: debugging does not work in Firefox (version 75), as per the documentation specifically the prerequisites
...
➦
End-to-end Testing in C# ASP.Net MVC, Web API and SignalR
Jan 11, 2020
I’m a big fan of automated testing and a strong advocate of the development team owning automated tests. I find C# end-to-end integration tests an attractive offering as development teams are already familar with the language and how to write tests and so ver little upskilling is required.
I recently extended a collection of automated end-to-end integration tests for an ASP.Net .NET framework website. They were a great starting point, but only covered a small part of the service layer.
...
➦
C# SQL Database pagination using Dapper ORM
Nov 11, 2019
Database Pagination is something I have coded at every employer I have worked at. My approach has changed over the years, here is a look at how I would go about it now.
The requirements for this incarnation:
One database query should go across the wire, and we should both the Total Row Count as well as the Rows of the current page. Only the rows on a page should be returned from the database.
...
➦
OAuth with Azure Active Directory to a Function App
Jan 31, 2019
This article is about adding Azure Active Directory to a Function App. The same principles could be applied to an Azure Web App as this concept is for any Azure App Service.
In addition to securing a Function App via OAuth, I have the requirement that the secured Function App be called from another Function App. This means the calling Function App will need to run as an application identity, instead of as a user’s identity.
...
➦
Automated Deployment of Azure Functions - Azure DevOps Release Pipelines
Jun 15, 2018
This is the second article around automating deployments of Azure Functions. The first article can be found here.
This article focuses on deploying from Azure DevOps (formerly VSTS). It will address the second and third requirements discussed in the previous post, to recap:
The Function App should be created and maintained by the release pipeline.
The Function app must stay online whilst code is being deployed. Strangely this requirement took a considerable amount of research to resolve, maybe this was because Azure Functions were still in preview as I was researching.
...
➦