Core
How to block the execution of a method when running EF migration
It was located in the main project, not in which the dbcontext. But either way, it should work from the main project, because for EF commands both the source project and the other project where the dbcontext is located should be specified
24 replies
How to block the execution of a method when running EF migration
I found a solution which is available from .NET 7. EF exposes a static flag trough
EF.IsDesignTime
. I simply organized the Program.cs
content in a way to only have code needed for EF in design time.24 replies
How to block the execution of a method when running EF migration
The background service is an
IHostedLifecycleService
. I also create an instance of that just to do a http call, but all of this happens once.
When I run the EF command dotnet ef migrations add ...
it also executes the HTTP call. The app is not running when the migration is being created
24 replies
UUID v4 vs v7
I switched because the performance of the UUID 7 in Postgres is the same as an incremented value. A detailed benchmark can be seen here: https://ardentperf.com/2024/02/03/uuid-benchmark-war/
The only downside is that it takes up a lot of space
8 replies