Reputation: 315
So I'm having trouble determining how to add tables dynamically in a .NET Core web application. From my research it doesn't appear entity framework supports this feature. It's my understanding that EF is static, so all new tables would need to be created through migrations.
So I have 2 questions:
CREATE TABLE...
, like using Linq? Upvotes: 2
Views: 1545
Reputation: 14074
There's no way you can perform DDL tasks with EF.
You can however abuse the EntityFrameworkCore.Migrations
API if you want to. The docs are here: https://learn.microsoft.com/en-us/ef/core/api/microsoft.entityframeworkcore.migrations
If you intend to do so, be warned that the migrations API is not meant to be used this way. So things like SQL injection, etc. will have to be handled manually as far as I know (unless things changed in the recent past).
Upvotes: 1