Strongly Typed Ids in Entity Framework Core

So after searching a long while, and trying to get some more answer, I found it, here it is then. Thanks to Andrew Lock.

Strongly-typed IDs in EF Core: Using strongly-typed entity IDs to avoid primitive obsession - Part 4: https://andrewlock.net/strongly-typed-ids-in-ef-core-using-strongly-typed-entity-ids-to-avoid-primitive-obsession-part-4/

TL;DR / Summary of Andrew In this post I describe a solution to using strongly-typed IDs in your EF Core entities by using value converters and a custom IValueConverterSelector. The base ValueConverterSelector in the EF Core framework is used to register all built-in value conversions between primitive types. By deriving from this class, we can add our strongly-typed ID converters to this list, and get seamless conversion throughout our EF Core queries


I think you are out of luck. Your use case is extremely rare. And EF Core 3.1.1 is still struggling with putting SQL onto the database that is not broken in anything except the most base cases.

So, you would have to write something that goes through the LINQ tree and this likely is a tremendous amount of work, and if you stumble onto bugs on EF Core - which you will - have fun explaining that in your tickets.