It would be cool if you could export your diagram from this tool to simple C# Code First classes.
For example, I have a simple database with 2 tables:
Table User {
Id integer [primary key]
Username varchar
Role varchar
DateCreated timestamp
DealerId integer
}
Table Dealer {
Id integer [primary key]
}
Ref: Users.DealerId > Dealers.Id
That would export to something similar to:
User.cs
public class User
{
[key]
public int Id {get; set;}
public string {get; set;}
public string Role {get; set;}
public datetime DateCreated {get; set;}
public int DealerId {get; set;}
public Dealer Dealer {get; set;}
}
Dealer.cs
public class Dealer
{
[key]
public int Id {get; set;}
}
This would save a lot of time for C# developers, you can meet with the business, analyze and build the diagram in dbdiagram.io in the meeting while they explain the requirements. Then when you start coding you simply convert the diagram to C# classes and Entity Framework code first will build the database for you
Yea, I tried Bing AI Chat (which is Chat GPT 4) to do this before posting, but it failed. I also looked for tools online but I didn’t find any.
So this afternoon I wrote my own C# DotNet Core 7 Windows Desktop App to do it!
Yeah, we have to admit that the results of Bing AI Chat are strange for these questions. Perhaps it has been tailored specifically for search purposes. However, we tested your example with the ChatGPT. The answer is quite satisfactory: