in src/rider/main/kotlin/com/jetbrains/rider/plugins/efcore/features/terminal/smartExecute/EFCoreShellCommandHandler.kt [48:74]
override fun execute(project: Project, workingDirectory: String?, localSession: Boolean, command: String, executor: Executor): Boolean {
if (command.trim() == DOTNET_EF) {
val dataContext = SimpleDataContext.getProjectContext(project)
val popup = JBPopupFactory.getInstance()
.createActionGroupPopup(
EfCoreUiBundle.message("popup.title.ef.core.quick.actions"),
QuickActionsGroup(),
dataContext,
JBPopupFactory.ActionSelectionAid.ALPHA_NUMBERING,
false
)
popup.showCenteredInCurrentWindow(project)
return true
}
val dotnetProjectId = null
return with(command.trim().removePrefix(DOTNET_EF).trim()) {
when {
startsWith(KnownEfCommands.Migrations.add) -> AddMigrationAction().launch(project, dotnetProjectId)
startsWith(KnownEfCommands.Database.drop) -> DropDatabaseAction().launch(project, dotnetProjectId)
startsWith(KnownEfCommands.Database.update) -> UpdateDatabaseAction().launch(project, dotnetProjectId)
startsWith(KnownEfCommands.DbContext.scaffold) -> ScaffoldDbContextAction().launch(project, dotnetProjectId)
startsWith(KnownEfCommands.Migrations.remove) -> RemoveLastMigrationAction().launch(project, dotnetProjectId)
startsWith(KnownEfCommands.DbContext.script) -> GenerateScriptAction().launch(project, dotnetProjectId)
else -> false
}
}
}