Entity Framework Core logo

How to fix “System.InvalidOperationException: The property ‘ItemBody.AdditionalData’ could not be mapped because it is of type ‘IDictionary’, which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the ‘[NotMapped]’ attribute or by using ‘EntityTypeBuilder.Ignore’ in ‘OnModelCreating’.” in .NET 7 and Entity Framework?

Oof. What even is this title? Descriptive – sure, maybe – but also kinda long. Ah, okay. This article explains how to map complex data types to a SQL database when using Entity Framework. This time, I’m using Fluent API to do this. In my case, I just needed to…Continue reading How to fix “System.InvalidOperationException: The property ‘ItemBody.AdditionalData’ could not be mapped because it is of type ‘IDictionary’, which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the ‘[NotMapped]’ attribute or by using ‘EntityTypeBuilder.Ignore’ in ‘OnModelCreating’.” in .NET 7 and Entity Framework?

Entity Framework - am I right?

How to fix another weird Entity Framework Core dependency issue?

Okay – so that’s a non-descriptive title if I’ve ever written one – I apologize for that! I just couldn’t figure out a way to shorten the error when “Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore” is referencing “Microsoft.AspNetCore.Http.Abstractions”, and even though you’re not referencing that dependency directly, you get an error where you have both…Continue reading How to fix another weird Entity Framework Core dependency issue?

EF Core equals bonk - a quality Entity Framework meme right there.

How to run EF Core commands when your entities are in a different project from your dbcontext?

This article explains how to achieve that nice configuration where you can reuse your .NET EF Core (Entity Framework Core) entities in different projects – even being separate from the project holding your DbContexts! You might want to do this if you have a common data model between a number…Continue reading How to run EF Core commands when your entities are in a different project from your dbcontext?

Entity Framework Core logo

“An assembly specified in the application dependencies manifest was not found” when running Add-Migration in Entity Framework Core?

Another quick one – I’m sure this doesn’t apply to all cases, but I’m still logging it in case someone (like myself) stumbles upon the issue and finds help here. I was building a solution with some Azure Functions fetching and populating data in a database, and was planning on…Continue reading “An assembly specified in the application dependencies manifest was not found” when running Add-Migration in Entity Framework Core?

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 EF (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!…Continue reading “Conversion overflow” when reading numeric data from MS SQL database using Entity Framework

Dependency hell

How to resolve “Microsoft.Data.SqlClient is not supported on this platform.” in an Azure Function App?

Hah – another interesting one. This article describes how to resolve an error along the lines of “Microsoft.Data.SqlClient: Microsoft.Data.SqlClient is not supported on this platform.“, thrown by the Azure Functions host. Apparently, you can run into this issue either on your local development machine or even in Azure. Problem For…Continue reading How to resolve “Microsoft.Data.SqlClient is not supported on this platform.” in an Azure Function App?

Some men want to watch the build fail

How to resolve persistent “Build started… Build failed.” when trying to run Entity Framework Core commands?

This time, I’m happy to present you perhaps the simplest way of fixing an annoying and persistent issue with a misleading error message! Wait, does that sound familiar? It’s almost like that’s what half of my articles are about… Anyway, I was happily going my way about creating a couple…Continue reading How to resolve persistent “Build started… Build failed.” when trying to run Entity Framework Core commands?