I am porting our product's database to SQLite from another product that supported Guids. As we know, SQLite does not support Guids. I've got created an entity framework 6 model from my database (database first) and I need to build a query from C# that compares the Guid to one passed from the code.
The thing is I can't find any documentation on how the SQLite Entity Framework provider handles Guids. A web search didn't find anything useful for me, either. Just questions about using Entity Framework with SQLite.
Can anybody point me to the documentation, or maybe tell me how to work with Guids in a SQLite database through an EF6 model?
This database provider allows Entity Framework Core to be used with SQLite. The provider is maintained as part of the Entity Framework Core project.
EF Core 6.0 requires . NET 6.
With EF Core, data access is performed using a model. A model is made up of entity classes and a context object that represents a session with the database. The context object allows querying and saving data. For more information, see Creating a Model.
It appears that this was resolved in 1.0.95 however broken again in 1.0.97. The solution is to set the BinaryGUID property on the connection string to true and set the following environment variable (before you make the connection)
Environment.SetEnvironmentVariable("AppendManifestToken_SQLiteProviderManifest",";BinaryGUID=True;");
Data Source=c:\mydb.db;Version=3;BinaryGUID=True;
https://www.connectionstrings.com/sqlite/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With