Recently, I made a C # entity class generator using my spare time. Currently, Mysql and Oracle databases are supported.
Share the demo program and source code with everyone. Interested readers can continue to expand and support other databases, but I will do it myself if I have time.
The interface is as follows:
Directly write the database connection string and click the connection button to list all tables of the database. Select a table to generate an object class and click "generate object file" to generate the table.
The generated object classes are similar:
// ================================================ ========================================================== ==// File: defaultEntity. cs // Desc: the entity class of the table [TB_BIZ] // This entity class is automatically generated using the code generation tool (CSharpEntityBuilder. // Called by: XX // Auth: XX // Date: april 08, 2013 ================================================ ========================================================== ====// Change History // ========================================= ========================================================== ============/// Date: author: Description: // -------- ------------------- // ================================ ========================================================== ============/// Copyright (C) 2010-2020 http://tuyile006.cnblogs.com/// ============================================= ========================================================== ==== using System; using System. data; namespace DefaultNameSpace {// <summary> // entity class of the table [TB_BIZ] /// </summary> public class DefaultEntity {# region member variable, constrfunction string m_strTableName; int m_CATALOGID; int m_PARENTID; string m_CATALOGNAME; // <summary> // initialize a new instance of the DefaultEntity class. /// </Summary> public DefaultEntity () {m_strTableName = "TB_BIZ ";} # endregion # region field attribute /// <summary> /// obtain the database table name corresponding to the object class. /// </Summary> public string TableName {get {return m_strTableName ;}} /// <summary> /// Business ID /// </summary> public int CATALOGID {get {return m_CATALOGID;} set {m_CATALOGID = value ;}} /// <summary> /// parent Business ID /// </summary> public int PARENTID {get {return m_PARENTID;} set {m_PARENTID = value ;}} /// <summary> /// business name /// </summary> public string CATALOGNAME {get {return m_CATALOGNAME;} set {m_CATALOGNAME = value ;}# endregion }}
Demo: Demo
Source Code: Code