Say "Dependency Injection" one more time I DARE YOU

How to inject EF Core DbContext in an Azure Function?

Ah, one more on the related topics of different configurations for your Azure Function apps. In this article, I’ll describe how you can configure the Entity Framework Core database context to be injected into your Azure Functions App. In my experience, this is a very typical and often-needed model to structure your Azure Functions, so while tooling and templates aren’t quite there, it’s worthwhile to document here. Solution I’ve posted before about how to instantiate a database context using DbContextOptionsBuilder – see a copy-pasteable example…Continue reading How to inject EF Core DbContext in an Azure Function?

Entity Framework - am I right?

“Conversion overflow” when reading numeric data from MS SQL database using Entity Framework

This article explains how to fix a weird situation where your .NET application utilizing Entity Framework or Entity Framework Core simply crashes without any way to recover or catch the Exception. You only get errors somewhere along the lines of “conversion overflow”. Ah – what a fun little issue! Problem So when you’re trying to instantiate an entity with a property of type decimal, you’ll get one of the 2 following exceptions with varying Call Stacks: Conversion overflow or: Arithmetic overflow error converting numeric to data type numeric…Continue reading “Conversion overflow” when reading numeric data from MS SQL database using Entity Framework

Azure Functions CLI - such a pretty logo for such an awesome functionality

How to configure Azure Function’s startup?

Azure Functions use dependency injection, and that allows us to define all kinds of prebuilt or custom-built services as being available for our functions really easily. This is a really easy way to initialize scoped resources to be used in your different functions… But how do you actually configure them in an Azure Functions App? Problem Okay, a step back – there’s a bit of a problem that we need to resolve before we can proceed with the configuration. When you create a new Azure…Continue reading How to configure Azure Function’s startup?

git logo

How to list your git stashes?

Long story short, yes, I really had to google this, and since top results seemed to give pretty unclear (or even wrong) answers, I decided to document it for myself. Maybe it’ll be helpful to someone else too! And just to state the obvious: I’m using GitHub Desktop for most of my mandatory Git stuff, but for whenever I have to run any git commands, I run Windows PowerShell (git exe is added to PATH variable). Solution Well, it’s actually very, VERY simple. You can…Continue reading How to list your git stashes?

Powershell is hell

How to fix “System.InvalidOperationException: PowerShell Gallery is currently unavailable.”

This article explains how to fix an issue when updating a module in PowerShell. The error is something along the lines of: “System.InvalidOperationException: PowerShell Gallery is currently unavailable. Please try again later.” The whole error looks something like the one below, although you can probably get it for many different commandlets. Luckily, like usual, there are a few ways to fix this! Solution