How do I visually design my database with Entity Framework Core?

c# entity-framework entity-framework-core sql-server typescript

Question

I am wondering myself, how I should design my database scheme (in terms of efficiency and visuality).

I am developing a ASP.NET Core application with Angular 2 and I am using Entity Framework Core ("Microsoft.EntityFrameworkCore": "1.0.0"), since its my favourite ORM. I definitely prefer the SQL Server 2012, but if there are better options for designing my scheme available for other database management systems, I could switch to something else like PostgreSQL.

EntityFrameworkCore however doesn't support designing the DataContext (with all its POCO classes) with the EDMX designer anymore.

Can you give me any advice how I can design my database visually and automatically generate my POCO classes (and maybe also my TypeScript classes)?

Can you recommend me a good tool for designing my scheme? (At least more convenient than SQL Server Management Studio. I liked the EDMX designer)

EDIT 2019-03-28

Since the latest changelog (18.0 Preview 7) of SQL Server Management Studio announced, that Database Diagrams are deprecated, I am really in need of an alternative to visualize my databases, as soon as possible.

EDIT 2019-04-03

Since someone might stumble upon this question and no one provided an answer for my question, yet... Here you go: VS Extension: Entity Developer ORM Designer for LINQ to SQL

EDIT 2019-07-15

From the SSMS 19.1 Changelog:

Database diagrams were added back into SSMS.

1
12
7/15/2019 2:17:42 PM

Popular Answer

If you prefer to start with the database, you can use whatever design tools you find most useful for whichever database platform you prefer to create the database, and then use EF commands to scaffold your model and context from the database. You can execute commands from the Package Manager Console just as with migrations in previous versions of EF:

Scaffold-DbContext "Server=yourServer;Database=yourDb;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

The official documentation covers reverse engineering a model from an existing database

5
8/5/2016 12:57:53 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow