Skip to content
| Marketplace
Sign in
Visual Studio>Templates>Entity Framework Code First Generator Templates
Entity Framework Code First Generator Templates

Entity Framework Code First Generator Templates

CONWID

|
24,758 installs
| (0) | Free
This extension adds templates that can be used to create custom sql generators or custom code scaffolders from Entity Framework Code First migrations.
Download

On my blog one of the most prominently featured topics if Entity Framework. A not very-well known, but very useful feature of Entity Framework Code First is the ability to add your custom sql generators that are used when you create sql scripts from your migrations and to add your custom code generators that are used when C# code is created from your migrations. I have used these features in my previous posts: here's the one for auditing (fun fact: this is one of my greatest hits), the one for soft delete, and the one for adding an index automatically for TPH discriminators.

I have used custom generators in some of my projects as well, but since this is not a very well known and widely used feature, finding the corresponding documentation takes some time :) So I thought I would create a Visual Studio extension that has an item template for a custom sql generator and a custom C# code generator.

[After downloading the extension, you have the option to add a "Custom migration code generator" or a "Custom migration sql generator" to the project:

The generator items add nice little classes with the required boilerplate and some comments to help you get started:

I understand that this probably will never be one of the most downloaded extensions, but hopefully some of you might find it useful ;) Check out the source code on Github, if you feel like it. Ideas and PRs are always welcome.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft