Page 1 of 1

CAn SQLiteScalarFunction be used in DbMigration?

Posted: Wed 31 Oct 2018 16:41
by klosels
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?

Re: CAn SQLiteScalarFunction be used in DbMigration?

Posted: Wed 07 Nov 2018 19:07
by Shalex
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.