C # entity class Generator

Source: Internet
Author: User
Tags class generator

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.