I have a postgres database and I want to generate the entity class of a table. I need this in order to connect to the database without using something like :
NpgsqlCommand cmd = new NpgsqlCommand("SELECT * FROM TABLE1", conn);
How can I obtain the class?
Can you provide some detailed steps? I can’t seem to find this anywhere.
Thanks in advance!
Entity classes are usually hand-written, or are generated from a schema then hand-tweaked. In the Java world many tools like NetBeans and Eclipse can help, but things seem much less mature in the C#/.NET world if you’re not using Microsoft databases and Microsoft query tools.
This answer refers to a few useful tools, and a quick search also found the NHibernate entity generator, which seems to be part of a tool with support for Entity Framework and LINQ too.