Visual Studio Code Snippets to Make Coding EF Core a Little Simpler

I’ve been using the user snippet feature of Visual Studio Code to make it easier to get some of the code I commonly use for EF Core into my files. For example I have C# snippets for DbContext to create a constructor overload that takes in a DbContextOptions parameter, OnConfiguring or OnModeling . I have json snippets to add in the EFCore Commands dependency and the Tools section with EF Core tools.


github.com/julielerman/EFCoreSnippetsForVSCode


I finally created a github repository to share them. Since you’ll need to add the csharp snippets into your existing csharp snippets and the same with the json, i have put them into separate csharp.json and json.json files from which you can copy and past my snippets into your own.


Although the instructions are on the user defined snippets page I just linked to, the TL;DR is:


From menu, choose Code, Preferences then User Snippets


2016-10-30_11-56-58


That will open a list of snippet files. Choose C# for the C# snippets and Json for the Json snippets. Paste in my snippets!


2016-10-30_11-57-25

 •  0 comments  •  flag
Share on Twitter
Published on October 30, 2016 09:09
No comments have been added yet.


Julia Lerman's Blog

Julia Lerman
Julia Lerman isn't a Goodreads Author (yet), but they do have a blog, so here are some recent posts imported from their feed.
Follow Julia Lerman's blog with rss.