EFDesigner
Entity Framework visual design surface and code-first code generation for EF6, Core and beyond
Install / Use
/learn @msawczyn/EFDesignerREADME
Entity Framework Designer - VS2019 Version
Entity Framework visual design surface and code-first code generation for EF6, EFCore and beyond.
This package is for VS2019. The VS2022 version is available in the EFDesigner2022 project
Model and generate code for both Entity Framework v6.x and Entity Framework Core 2.x, 3.x and 5.
Install with NuGet from the Visual Studio Marketplace
Complete documentation in the project's documentation site
<table><tbody><tr><td> <img src="https://msawczyn.github.io/EFDesigner/images/Designer.jpg"> </td></tr></tbody></table>This Visual Studio 2019 extension is the easiest way to add a consistently correct Entity Framework (EF6 or EFCore) model to your project.
It's an opinionated code generator, adding a new file type (.efmodel) that allows for fast, easy and, most importantly, visual design of persistent classes. Inheritance, unidirectional and bidirectional associations are all supported. Enumerations are also included in the visual model, as is the ability to add text blocks to explain potentially arcane parts of your design.
While giving you complete control over how the code is generated you'll be able to create, out of the box, sophisticated, consistent and correct Entity Framework code that can be regenerated when your model changes. And, since the code is written using partial classes, any additions you make to your generated code are retained across subsequent generations. The designer doesn't need to be present to use the code that's generated - it generates standard C#, using the code-first, fluent API - so the tool doesn't become a dependency to your project.
If you are used to the EF visual modeling that comes with Visual Studio, you'll be pretty much at home. The goal was to duplicate at least those features and, in addition, add all the little things that should have been there. Things like:
- importing entities from C# source, or existing DbContext definitions (including their entities) from compiled EF6 or EFCore assemblies
- multiple views of your model to highlight important aspects of your design
- the ability to show and hide parts of the model
- easy customization of generated output by editing or even replacing the T4 templates
- entities by default generated as partial classes so the generated code can be easily extended
- class and enumeration nodes that can be colored to visually group the model
- different concerns being generated into different subdirectories (entities, enums, dbcontext)
- string length, index flags, required attributes and other properties being available in the designer
and many other nice-to-have bits.
Code generation is completely customizable via T4 templates. The tool installs templates that target both EF6 and EFCore, and generate both a code-first DbContext class and POCO entity classes. The EF6 template's DbContext code is written to allow consumption in ASP.Net Core in addition to any other project type, so you'll have flexibility in your development.
Note: This tool does not reverse engineer from the database (i.e., "database-first"). Microsoft has provided tools for that, and there are other, well-maintained opensourced projects that provide that functionality as well.
You can read more about how to use the designer in the Documentation site.
Shout out and a big thanks
<!-- <table border="0" cellspacing="0" cellpadding="0" style="border:none"> <tr vstyle="center" style="border:none"><td>to</td><td><a href="https://www.jetbrains.com/?from=EFDesigner"><img src="https://msawczyn.github.io/EFDesigner/images/jetbrains-variant-2a.png"></a></td><td>for providing free development tools to support this project.</td></tr> </table> -->to <a href="https://www.jetbrains.com/?from=EFDesigner"><img src="https://msawczyn.github.io/EFDesigner/images/jetbrains-variant-2a.png"></a> for providing free development tools to support this project.
Change Log
3.0.8
- Autoproperty setting for End1 on association wasn't persisting, so reloading the model lost that change
- Fixed a number of issues with importing compiled assemblies
- Fixed coloring of cascade delete associations when flagged on the model (see https://github.com/msawczyn/EFDesigner/issues/291)
- Fixed missing '$' in generator template that was generating bad code for table schemas (see https://github.com/msawczyn/EFDesigner/issues/289)
- Restored auto-instantiation of dependent objects in entity constructors (see https://github.com/msawczyn/EFDesigner/issues/287)
- Added Microsoft.VisualStudio.Modeling.Components.15.0.dll to DslPackage assembly (see https://github.com/msawczyn/EFDesigner/issues/293)
- Removed validations on model open/load that prevented a misconfigured model from loading. Errors will still be shown during editing and when saving.
- New context menu item to add class elements at the cursor position on a diagram (thanks to dcastenholz for the addition)
- New context menu item to generate code from the Solution Explorer (thanks to dcastenholz for the addition)
- Method visibility changes to allow MEF extensions to supply new icons and to layout a diagram (thanks to dcastenholz for the addition)
- Added ability to copy current diagram to clipboard
- DbContext fix for configuring associations with backing fields
- Code generation fix for associations with backing fields
- Fix where parsing EF version numbers should be culture-neutral (see https://github.com/msawczyn/EFDesigner/issues/282)
- Fixed circular logic flaw in identity properties for database views (see https://github.com/msawczyn/EFDesigner/issues/275)
- Corrected tracking property access modes from the default to overrides in entity attributes
- Added context menu choice to visually align node elements on diagrams.
- Fix for detecting correct EF version when anything with "Latest" in it is configured (see https://github.com/msawczyn/EFDesigner/issues/266)
- Fix to generate correct initial value code for decimal properties (see https://github.com/msawczyn/EFDesigner/issues/268)
- Fix for constructor code generation in 1-N unidirectional associations (see https://github.com/msawczyn/EFDesigner/issues/263)
- Removed addition of default objects in constructors for required associations for all EF versions (see https://github.com/msawczyn/EFDesigner/issues/271)
- Added VS UML icon for model file in solution explorer (thanks to https://github.com/dcastenholz for the change)
- Classes with custom interfaces can now display an indicator with a tooltip indicating the interface type(s). This glyph is enabled/disabled at model level.
- Added ability to specify that an association should be automatically included in any queries that use it (EFCore5 only). The association connector will appear bolder if at least one end is auto-included.
- Updated association tooltip to indicate which, if any, end is auto-included
- Fix to ensure database collation overrides don't get applied to the wrong column types
- Fix to allow 1..1 association to owned types in EFCore5 (see https://github.com/msawczyn/EFDesigner/issues/252)
- Fix to calculate EF version number correctly when "Latest" was specified in designer (see https://github.com/msawczyn/EFDesigner/issues/254)
- Fix to generate correct DeleteBehavior enum values in EFCore < v3 (see https://github.com/msawczyn/EFDesigner/issues/257)
- Removed INotifyPropertyChanged option from designer. Implementers wanting this interface can add it to a partial class file as any other interface, as there's really nothing special about it.
- Generated code now honors the ExcludeFromMigration setting for a class
- Added setting on designer surface to set visibility defaults for entity default constructors, and overrides for that setting on the entities
- Added
public bool ModelAttribute.IsForeignKeyPropertyfor use by developers doing custom code generation from the model - Added option for turning off DbSet and table name pluralization (see https://github.com/msawczyn/EFDesigner/issues/246)
- Added option for how to name foreign key shadow properties - either with or without underscores (see https://github.com/msawczyn/EFDesigner/issues/250)
- Added option to generate DbContextFactory class, for use in context pooling. Asking for DbContext factory method generation disables generating OnCreating method, since they don't play well together.
- Changed property editor for custom attributes to be multiline, to ease editing (see https://github.com/msawczyn/EFDesigner/issues/251)
- Fixes for code generation of new EFCore5 database collation options
- Fixed condition where sometimes generated code in entity default constructors would create infinitely recursive calls
- Stopped escaping standard XML comment tags in summary and description fields (see https://github.com/msawczyn/EFDesigner/issues/248)
- Due to the new seeding needs in EFCore5, setters for identity properties are now public even if set to be auto-generated
- Added [Description] attribute (to classes, properties, enums and enum values where summary was non-blank) to facilitate tooling use
- Fixed an issue where EFCore5 code was generating cascade de
Related Skills
diffs
338.7kUse the diffs tool to produce real, shareable diffs (viewer URL, file artifact, or both) instead of manual edit summaries.
clearshot
Structured screenshot analysis for UI implementation and critique. Analyzes every UI screenshot with a 5×5 spatial grid, full element inventory, and design system extraction — facts and taste together, every time. Escalates to full implementation blueprint when building. Trigger on any digital interface image file (png, jpg, gif, webp — websites, apps, dashboards, mockups, wireframes) or commands like 'analyse this screenshot,' 'rebuild this,' 'match this design,' 'clone this.' Skip for non-UI images (photos, memes, charts) unless the user explicitly wants to build a UI from them. Does NOT trigger on HTML source code, CSS, SVGs, or any code pasted as text.
openpencil
1.8kThe world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.
HappyColorBlend
HappyColorBlendVibe Project Guidelines Project Overview HappyColorBlendVibe is a Figma plugin for color palette generation with advanced tint/shade blending capabilities. It allows designers to
