Quantcast
Channel: Andrew Lock | .NET Escapades
Browsing all 743 articles
Browse latest View live
↧

Image may be NSFW.
Clik here to view.

Why is string.GetHashCode() different each time I run my program in .NET Core?

This post is part of the second annual C# Advent. Check out the home page for up to 50 C# blog posts in December 2018! In this post I describe a characteristic about GetHashCode() that was new to me...

View Article


Image may be NSFW.
Clik here to view.

Dark mode now available!

🎵 I am a man who walks alone And when I'm walking a dark road At night or strolling through the park When the light begins to change I sometimes feel a little strange A little anxious, when it's dark....

View Article


Image may be NSFW.
Clik here to view.

Creating a git repo with Azure Repos and trying out Git LFS

I was recently working on a side project that seemed like it would have lots of large, binary assets. Unfortunately, that's just the sort of thing Git struggles with. As an experiment, I decided to try...

View Article

Image may be NSFW.
Clik here to view.

Creating an AWS policy for calling the SES mailbox simulator from CodeBuild

This isn't a long, or especially interesting post, it just describes something I needed to do the other day, and couldn't explicitly find anywhere that described how to do it. As the title suggests, it...

View Article

Image may be NSFW.
Clik here to view.

Using dependency injection with Twilio SMS and ASP.NET Core 2.1

ASP.NET Core is built with first-class support for dependency injection (DI). It's used heavily by the framework, but you can also use it with your own classes. The Twilio C# helper libraries are...

View Article


Image may be NSFW.
Clik here to view.

Running async tasks on app startup in ASP.NET Core (Part 1)

Sometimes you need to perform one-off initialisation logic before your app starts up properly. For example, you might want to validate your configuration is correct, populate a cache, or run database...

View Article

Image may be NSFW.
Clik here to view.

Running async tasks on app startup in ASP.NET Core (Part 2)

In my previous post I described the need to run one-off asynchronous tasks on app start up. This post follows on directly from the last one, so if you haven't already, I suggest you read that one...

View Article

Image may be NSFW.
Clik here to view.

Running async tasks on app startup in ASP.NET Core (Part 3 - Feedback)

This post is a short follow-up to my previous two posts on running async tasks in ASP.NET Core. In this post I relay some feedback I've had, both on the examples I used to demonstrate the problem, and...

View Article


Image may be NSFW.
Clik here to view.

Running async tasks on app startup in ASP.NET Core (Part 4 - using health...

In this post, I show an approach to running async tasks on app startup which I discounted in my first post in this series, but which Damian Hickey recently expressed a preference for. This approach...

View Article


Image may be NSFW.
Clik here to view.

Reducing initial request latency by pre-building services in a startup task...

This post follows on somewhat from my recent posts on running async startup tasks in ASP.NET Core. Rather than discuss a general approach to running startup tasks, this post discusses an example of a...

View Article

Image may be NSFW.
Clik here to view.

An introduction to ASP.NET Core Razor Pages

Razor pages is a new aspect of ASP.NET Core MVC introduced in ASP.NET Core 2.0. It offers a "page-based" approach for building server-side rendered apps in ASP.NET Core and can coexist with...

View Article

Image may be NSFW.
Clik here to view.

Creating my first GitHub app with Probot: Part 1 - create-probot-app

This is the first post in a short series on creating a simple GitHub app with Probot. In this post I describe why I decided to create a GitHub app, and how I built and tested a "Hello World" app using...

View Article

Image may be NSFW.
Clik here to view.

Creating my first GitHub app with Probot: Part 2 - creating the...

In my last post I showed how to get started building a GitHub bot using Probot and create-probot-app. In this post we'll take a look at some code; we'll explore the generated template, and then update...

View Article


Image may be NSFW.
Clik here to view.

Creating my first GitHub app with Probot: Part 3 - deploying to Glitch

In the first post in this series, I described creating a GitHub app using Probot and create-probot-app. In my previous post I walked through the default template and customised it to provide the...

View Article

Image may be NSFW.
Clik here to view.

Why isn't my session state working in ASP.NET Core? Session state, GDPR, and...

In this post I describe a problem that I've been asked about several times related to session state. The scenario goes something like this: Scaffold a new ASP.NET Core application Set a string in...

View Article


Image may be NSFW.
Clik here to view.

Creating a not-empty GUID validation attribute and a not-default validation...

In this post I describe a handy validation attribute used during ASP.NET Core model binding for verifying that a GUID doesn't have the default value of Guid.Empty. I always find myself re-creating it...

View Article

Image may be NSFW.
Clik here to view.

Creating my first Azure Functions v2.0 app: a WebHook and a timer

In this post I show how to create your first Azure Functions app, consisting of a timer that runs on a schedule to trigger a build on Netlify, and a WebHook that runs in response to an HTTP request...

View Article


Image may be NSFW.
Clik here to view.

Exploring the .NET Core MCR Docker files (updated): runtime vs aspnet vs sdk

This is an update to my previous post explaining the difference between the various Linux .NET docker files. Microsoft recently moved its Docker images to Microsoft Container Regitsry (MCR) instead of...

View Article

Image may be NSFW.
Clik here to view.

Using Lambda@Edge to handle Angular client-side routing with S3 and CloudFront

In this post I show how to a handle an issue you get when hosting a SPA on AWS with S3 and CloudFront, where reloading the app gives a 403 or 404 response. I'll show how to use Lambda@Edge to handle...

View Article

Image may be NSFW.
Clik here to view.

Using strongly-typed entity IDs to avoid primitive obsession (Part 1)

Have you ever requested an entity from a service (web API / database / generic service) and got a 404 / not found response when you're sure it exists? I've seen it quite a few times, and it sometimes...

View Article
Browsing all 743 articles
Browse latest View live