Skip to content

SetTrend/EFC-SQLite-MRE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimum Reproducible Example

Foreign Key Issue in Entity Framework Core with SQLite

For details, see this question issue in the Entity Framework Core repository: /dotnet/efcore/issues/34543.

Observation

Using the SQLite provider, I referenced the Language entity from the DataText entity using a foreign key. This doesn't seem possible.

In OnModelCreating() I'm getting the following error message:

System.InvalidOperationException: The 'Language' property 'DataText.Language' could not be
mapped because the database provider does not support this type. Consider converting the
property value to a type supported by the database using a value converter. See
https://aka.ms/efcore-docs-value-converters for more information. Alternately, exclude the
property from the model using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore'
in 'OnModelCreating'.

Run The MRE

In order to reproduce this MRE's issue, run this solution's sole MSTest unit test @ DatabaseBackEndTests.CreateDatabaseTests.SuccessfullyCreateDatabaseAndDelete().

Remarks

I want to avoid FluentAPI configuration as it would scatter my code. Convention by itself should run smoothly here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages