July 15 2025
Working with EF Core and PostgreSQL in .NET can be a rewarding experience - until you find yourself deep in the weeds of manually writing schema definitions, updating mappings, and constantly jumping between your database and C# code just to keep things in sync.
Thatâs where visual modeling becomes a game changer.
Instead of hand-coding every entity, relationship, and mapping configuration, visual EF Core modeling gives you a high-level, intuitive view of your data modelâmaking it easier to design, refactor, and maintain over time.
But until recently, this kind of tooling was mostly limited to SQL Server or traditional ORM tools. If you're building .NET applications with PostgreSQL, youâve probably felt the gap.
Entity Developer bridges that gap beautifully. With full support for EF Core and PostgreSQL-specific features like UUID, JSONB, and array types, it gives you a powerful visual design experience - while still generating clean, production-ready code under the hood.
In this article, Iâll walk you through how to use Entity Developer to create and manage your PostgreSQL EF Core models the easy (and visual) way - from model design and code generation to schema synchronization and beyond.
Letâs dive in.
Whether youâre a Visual Studio enthusiast or prefer working with standalone tools, Entity Developer has you covered. You can launch it as a separate application or install the extension directly into Visual Studio - whichever fits best into your workflow.
Once youâve got Entity Developer up and running, itâs time to create your first EF Core model.

Step-by-step:



Thatâs it - youâre ready to start visually designing your EF Core model. No need to write boilerplate code or fiddle with configuration files just to get started. The next step? Letâs design your schema the visual way.
For this example, Iâm going to model a simple blogging platform using three core entities: Blog, Post, and Comment.
Each Blog can have multiple Posts, and each Post can receive multiple Comments.
Iâll define key fields like UUID for primary keys, use PostgreSQL-friendly types like JSONB and arrays, and visually set up the relationships using Entity Developerâs drag-and-drop interface.
This small but realistic model gives us a solid foundation to explore how visual modeling works - while keeping things practical.
Creating Your First Class (Entity) and Properties
To start building your model, right-click anywhere on the design surface and choose âAdd Classâ from the context menu. You can also use the toolbar button for quicker access.
This will create a new entity - give it a name like Blog, Post, or Comment. Once the class appears on the diagram:
Double-click the class (or right-click and choose Properties) to open the property editor.
Use the âAdd Propertyâ button to start defining fields: ⢠For Blog, you might add: Id (UUID), Title (Text), Description (Text), Tags (Text[]), CreatedAt (TimestampTZ)
Set each propertyâs: ⢠Name (e.g., Title) ⢠Type (e.g., Text, UUID, JSONB, TimestampTZ) ⢠Whether it's a Primary Key, Nullable, Default, etc.
Entity Developer makes this super visual - no need to write attributes or annotations. You just configure everything through the UI.

Result:

Setting Up Relationships (Foreign Keys)
Once your classes (entities) are in place, itâs time to connect them using relationships - like telling Entity Developer, "Each Post belongs to one Blog", or "Each Comment belongs to one Post".
This is super easy to do visually:
Drag from one class to another On the design surface, click on the small arrow or anchor point on the edge of the source class (e.g., Post), and drag it to the target class (e.g., Blog).
A dialog will pop up to define the association:
You can customize the association further: ⢠Rename navigation properties ⢠Make the relationship required or optional ⢠Configure cascade delete if needed
No need to manually type [ForeignKey] attributes or worry about EF conventions - Entity Developer handles the details behind the scenes.

Result:
This step is where the magic of visual modeling really shines. You can literally see your schema and relationships come together - making it easier to reason about and maintain.
Now, we can create EF Code or generate database for PostgreSQL.
Let's do that.
Once your model is complete, you can generate the EF Core classes by using the top menu bar (not the context menu):
Entity Developer will generate:
⢠Your DbContext class with DbSet
You can even customize the T4 templates if you want to adapt the code style to match your teamâs conventions.
If you're using Visual Studio integration, the generated files are added directly to your project. In the standalone version, theyâre placed in the output folder you specified.

Let's see how part of the BlogDbContext.cs file looks like:
public partial class BlogDbContext : DbContext { public BlogDbContext(DbContextOptions<BlogDbContext> options) : base(options) { OnCreated(); } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (!optionsBuilder.IsConfigured || (!optionsBuilder.Options.Extensions.OfType<RelationalOptionsExtension>().Any(ext => !string.IsNullOrEmpty(ext.ConnectionString) || ext.Connection != null) && !optionsBuilder.Options.Extensions.Any(ext => !(ext is RelationalOptionsExtension) && !(ext is CoreOptionsExtension)))) { } CustomizeConfiguration(ref optionsBuilder); base.OnConfiguring(optionsBuilder); } public virtual DbSet<Blog> Blogs { get; set; } public virtual DbSet<Post> Posts { get; set; } public virtual DbSet<Comment> Comments { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); this.BlogMapping(modelBuilder); this.CustomizeBlogMapping(modelBuilder); this.PostMapping(modelBuilder); this.CustomizePostMapping(modelBuilder); this.CommentMapping(modelBuilder); this.CustomizeCommentMapping(modelBuilder); RelationshipsMapping(modelBuilder); CustomizeMapping(ref modelBuilder); } ... }
And here is the Blog Entity:
public partial class Blog { public Blog() { this.Posts = new List<Post>(); OnCreated(); } public Guid ID { get; set; } public string Title { get; set; } public string Description { get; set; } public DateTime CreatedAt { get; set; } public virtual IList<Post> Posts { get; set; } #region Extensibility Method Definitions partial void OnCreated(); #endregion }
Everything is generated to match your model exactly - saving you from writing repetitive boilerplate by hand.
Generate PostgreSQL DDL Scripts
Next, letâs turn your model into an actual PostgreSQL schema. ⢠Go to the Model menu and choose Generate Database Script. ⢠Entity Developer will generate fully PostgreSQL-compatible SQL, including:

We get SQL result:

Entity Developer brings a lot of value to EF Core and PostgreSQL development, especially when you're working on complex models or collaborating in larger teams.
Hereâs why it stands out:
⢠Visual model design makes it easy to map out your data structure quickly, helping you avoid mistakes and spot relationships at a glance. No more trial-and-error with fluent API or annotations. ⢠It has full support for PostgreSQL-specific types, including UUID, JSONB, arrays, and custom enums - letting you take full advantage of PostgreSQL's capabilities without hacks or workarounds. ⢠The robust code generation engine ensures that your EF Core classes and DbContext are clean, consistent, and maintainable - whether you're building a new project or refactoring an old one. ⢠Seamless synchronization tools help you keep your model, code, and database aligned - even after the initial deployment. You can safely push or pull schema changes without worrying about data loss. ⢠And with IDE integration, you get design-time validation, query building, and refactoring tools right inside Visual Studio or in the standalone app - helping you stay productive from start to finish.
If you're working with EF Core and PostgreSQL, Entity Developer gives you the power to build, manage, and evolve your data model visually - while still generating solid, production-ready code behind the scenes. Also, important thing here is to know that Entity Developer doesn't support ONLY Postgres database. There are support for other such as MSSQL, MySQL, etc.
Ready to give it a spin?
Download the free trial, connect to your PostgreSQL database, and create your first EF Core model in minutes:
đ Entity Developer đ dotConnect for PostgreSQL
Let your model shape your application - not the other way around.
That's all from me today.
P.S. Follow me on YouTube.
1. Design Patterns that Deliver
This isnât just another design patterns book. Dive into real-world examples and practical solutions to real problems in real applications.Check out it here.
Go-to resource for understanding the core concepts of design patterns without the overwhelming complexity. In this concise and affordable ebook, I've distilled the essence of design patterns into an easy-to-digest format. It is a Beginner level. Check out it here.
Every Monday morning, I share 1 actionable tip on C#, .NET & Arcitecture topic, that you can use right away.
Join 20,000+ subscribers to improve your .NET Knowledge.
Subscribe to the TheCodeMan.net and be among the 20,000+ subscribers gaining practical tips and resources to enhance your .NET expertise.