Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding EF Core commands #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

strakamichal
Copy link

Hi,
I added new commands for Entity Framework CLI (dotnet ef).

New commands

extension.dotnet.ef.migrations.add

  1. ask user to select EF project
  2. ask the user to specify migration name
  3. execute the command
  4. open newly created file in editor (same as Visual Studio does)

extension.dotnet.ef.migrations.remove

  1. ask the user to select EF project
  2. execute the command
  3. show the result in the Output console

extension.dotnet.ef.migrations.list

  1. ask the user to select EF project
  2. execute the command
  3. show the result in the Output console

extension.dotnet.ef.database.update

  1. ask the user to select EF project
  2. ask user to specify target migration name (optional)
  3. execute the command
  4. show the result in the Output console

extension.dotnet.ef.dbcontext.info

  1. ask the user to select EF project
  2. execute the command
  3. show the result in the Output console

There are some formatting issues on my side which result in a completely changed package.json - in real I changed just description, activation events, and commands section.

Copy link
Owner

@leo-labs leo-labs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have had a first look, it does look fine in general and I am sure we can integrate most of this.
Before I have a closer look please address my comments so far.

@@ -0,0 +1,1231 @@
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it's not documented, but i've used yarn and not npm. Yarn uses yarn.lock so this package-lock.json is not needed

@@ -1,95 +1,121 @@
{
"name": "dotnet",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@strakamichal Can you go over the PR again and make sure that your line ending settings are correct in git and that your patches do not change every line ending even if they do not touch the file?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please check that you do not do reformatting :)

}
});
outputChannel.show();
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make also sure that there is a newline at the end of each file

async () => runAndshowErrorAsMessage(removeMigration, true)));
context.subscriptions.push(vscode.commands.registerCommand('extension.dotnet.ef.database.update',
async () => runAndshowErrorAsMessage(updateDatabase, true)));
context.subscriptions.push(vscode.commands.registerCommand('extension.dotnet.ef.dbcontext.info',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about the list and info commands. I do not have them currently for dotnet, mainly because they only print output. I want to think a little bit about that, but do you really use both and when?

return stdout.toString('utf8').split(/\r?\n/);
} else {
return [];
}
} catch(e) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is e.g. an unnecessary formatting change

@leo-labs leo-labs self-assigned this Nov 27, 2020
@leo-labs leo-labs mentioned this pull request Nov 27, 2020
@leo-labs leo-labs linked an issue Nov 27, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add dotnet ef commands
2 participants