Jan 26

I was recently asked how to POST a Raw String Body Using DalSoft RestClient, this reminded me that the documentation for DalSoft RestClient is a little out of date.

Updating the docs has been on my todo list for a while now, so I’ve made a new years resolution to get this done. I’m going to start with a series of posts about what you can do with DalSoft RestClient, I’ll then rework these posts into the new docs.

Here’s the first post it’s a quick one – HTTP POST a Raw String Body Using C#

var client = new RestClient("https://your-server/api");
var response = await client.Resource("your-api-resource").Post("string that you want to post");

Yes you can do this as one liner with HttpClient or using one of the plethora of nuget Rest Client Packages, but you would be missing out on easy testing and pipelines then!

Like what you see? There’s a lot more head over to the DalSoft RestClient docs and GitHub Repo.

Tagged with:
Aug 04

Since starting the project in Jan 2015 one of the most asked for features has been full static support (you have always been able to cast responses via duck typing). Inspired by libraries written in dynamic languages like JavaScript and Python – the idea behind RestClient was to reduce the fiction and ceremony when working with Rest API’s, and later on HTTP in general.

I’ve always wanted to add static typing to be more inline with what is expected from a C# library, but wanted to do it in such way that the original concept remained, and that all code is backwards compatible. I’ve now spent the time required to change the package, and this is the result:

DalSoft Rest Client https://github.com/DalSoft/DalSoft.RestClient

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:
preload preload preload