Oct 30

I recently needed to use Twitter’s API along with it’s OAuth 1.0 implementation in .NET Core. As part of this work I created a DalSoft.RestClient Handler, and released it as a full SDK.

Continue reading »

Tagged with:
Aug 08

Prior to .NET Core 2.1 anyone who has tried to use HttpClient at scale (maybe from a microservice) may have run into the dreaded socket exhaustion issue.

Socket exhaustion happens because HttpClient is designed to be instantiated once and re-used throughout the life of an application, if you make HTTP calls in a server application for every request you will run out of sockets (because sockets get left in TIME_WAIT state for 240 seconds by default).

Using IHttpClientFactory can improve performance by 43%!

Continue reading »

Tagged with:
Dec 13

Recently I’ve been playing around with Entity Framework Core and it’s been a great positive experience overall, however as I started to port one of my projects over I fell foul of the lack of Seeding support. For those that haven’t used the Seed functionality in EF 6, it’s basically a method to populate the database with data that is invoked when migrations finish. There is a open GitHub issue regarding seeding support in EF Core.

My requirements are simple I’d like to use the dotnet CLI to run environment specific Migrations and Seeding from my continuous deployment pipeline. In this post I’m going to show you how I got environment specific Migrations and Seeding working. There are a couple of things that work differently that we need to workaround but that’s fine.

Continue reading »

Tagged with:
Sep 30

Recently I tweeted about the Azure App Service Team announcement that you can now officially run MySQL in-app, that means running MySQL using the same resources as your web app instance. I see this as a game changer as we move to microservices a natural paradigm shift is also to move away from monolithic databases too. I’ll follow up more on this in future posts, but right now this post is about migrating your existing WordPress blob to Azure.

Continue reading »

Tagged with:
Jan 13

I like to use OWIN with Web API unfortunately Web API Help pages is MVC and actually doesn’t work first time with OWIN, so much so I asked a Stack Overflow question about it (which I ended up answering myself). You can get it working on IIS with minimal effort, but not on self host this is because MVC requires (pre vNext) System.Web.

At first I gave up and tried Swagger for my docs, but I came back to Web API Help Pages. What I like about Web API Help Pages is at it’s heart it’s just a set of Razor templates. And for me using Razor templates is about as easy as it gets. So I thought ‘How hard can it be to make Web API help pages work with self host?’ A quick Google revealed that Yao has already managed to get Web API Help Pages working on self host using T4 templates, so if I do something similar but using Razor I’m in business.

Continue reading »

preload preload preload