Closed zelenij closed 3 years ago
Are you using an IEntityTypeConfiguration<Module>
to define the Key for Module
?
If not you'll need to annotate the type like so
[<CLIMutable>]
type Module = {
[<Key>]
Id: int
Name: string
Version: string
CreatedAt: DateTime
LastUpdated: DateTime
}
Hi @zelenij Can you confirm if this issue is resolved for you in https://www.nuget.org/packages/EntityFrameworkCore.FSharp/5.0.3-alpha5
Seems still to happen, with the latest version...
Actually, please ignore for now, seems to be working after some tweaking :)
To Reproduce
I have a rather simple entity, defined in project A. I am trying to create migrations in project B, which has A as a reference. I am also trying use ASP.NET Identity with a custom user implementation, if that affects anything.
Entity:
DbContext:
Seems quite straightforward. Id should be Module's key by convention, according to the docs. But when running migrations I get this exception:
Expected behavior
I would expect the migration to succeed