简体   繁体   中英

Creating SQLite Virtual Table with EF context.Database.EnsureCreated?

Would be possible to create SQLite Virtual Table using EF Core context.Database.EnsureCreated() ? I would expect something like [Virtual] attribute to the respective model class.

The reason for this question is using free text search (FTS) for SQLite in-memory DB which requires virtual table. I understand that I can use runtime migrations but EnsureCreated() is so neat and convenient.

It seems to be not possible using context.Database.EnsureCreated() directly for such specifics but a runtime migration works just fine. I only had to replace this line with very similar context.Database.Migrate() (having migration already in the project, of course) and that's it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM