CAn SQLiteScalarFunction be used in DbMigration?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
klosels
Posts: 10
Joined: Wed 31 Oct 2018 16:33

CAn SQLiteScalarFunction be used in DbMigration?

Post by klosels » Wed 31 Oct 2018 16:41

I'm using dotConnect for SQLite with EF 6.1 and EF migrations.

Is it possible (and how) to define a SQLiteScalarFunction which then could be called in the SQL code which is executed via DbMigration.Up when running the migration?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: CAn SQLiteScalarFunction be used in DbMigration?

Post by Shalex » Wed 07 Nov 2018 19:07

1. Create the SQLiteConnection object.

2. Register your function in the conn.StateChange event handler when State changes from Closed to Opened: https://www.devart.com/dotconnect/sqlit ... ction.html.

3. Pass your connection object to constructor of the context for EF migration.

Post Reply