bubibubi / JetEntityFrameworkProvider

Microsoft Access (Jet) Entity Framework provider
89 stars 26 forks source link

Renaming a foreign key: Required attribute does not work anymore #40

Closed PatriceDargenton closed 5 years ago

PatriceDargenton commented 5 years ago

Using this code, we can choose explicitly the name of a foreign key:

public virtual Standard Standard { get; set; } // Standard_StandardId

[ForeignKey("StandardId")] public virtual Standard Standard { get; set; } public int StandardId { get; set; }

It works fine, but the Required attribute no longer works then. Any solution?

bubibubi commented 5 years ago

To understand what's happening you can enable SQL command trace. The commands are traced to console. The statement to enable the trace is JetConnection.ShowSqlStatements = true

PatriceDargenton commented 5 years ago

Ok, using SQL command trace, I found my mistake: in fact everything works fine, I confused something! Thank you!