CYQ.Data 框架的枚举或实体类生成工具。(Build Entity or Enum For CYQ.Data)
Foreword:
Let's take a look at the V4.55 enumeration generator interface, which is a bit better than V4.5, but it is not very satisfactory, and it still feels inconvenient to use.
Improvements in the use of ideas:
The idea of the VS plugin:
I used to write the Addin plugin method to integrate into the VS development environment. However, due to many things, I couldn’t write it down, so I didn’t write it.
Due to the tight reminder of netizens, I started to write the Addin plugin yesterday, ready to get a demo, look at the basic process of Addin, and watch a few online tutorials, which are extremely simple, and the one that reports the error.
After several times of quiet debugging, I found that the English version of the default version of the Chinese version of the local language generated a bug, and after hard work toss, can also produce a menu, click can also produce something.
Found "external tools":
But I feel that it is uncomfortable to use Addin to develop, the tool menu is much more, and I realize that this is an "external tool":
Click it out:
With simple configuration, tools can also be integrated. Once confirmed, you can see the “CYQ.Data Project Configuration” menu in the menu from the previous picture.
Compare Addin with external tools:
Addin: It can take some internal information of the VS environment, including open documents, members of the document class, etc. If you want to develop something for the project in the VS solution, such as adding comments to all documents. The class can toss this.
External tools: relatively independent, just introduce a link click, can be developed independently, add external tool integration after completion, suitable for tossing things that are not related to VS internal environment variables, such as CYQ.Data project configuration tool.
Determined to use an external tool:
The diagram of the CYQ.Data.ProjectTool configuration tool is as follows:
Example of CS code for a table after ORM pattern generation:
{
public class the MyUsers: CYQ.Data.Orm.OrmBase
{
public the MyUsers ()
{
Base .SetInit ( the this , " the MyUsers " , " DefaultConn2 " );
}
Private Int32 _ID;
public Int32 _ID
{
GET
{
Return _ID;
}
set
{
_ID = value;
}
}
private String _UserName;
Public String _UserName
{
get
{
return _UserName;
}
set
{
_UserName = value;
}
}
private DateTime _CreateTime;
public DateTime _CreateTime
{
get
{
return _CreateTime;
}
set
{
_CreateTime = value;
}
}
}
}
Relative improvements to the CYQ.Data project configuration tool:
In this enumeration evolution to configuration tools, mainly to make some subtractive improvements.
1: Generate view and stored procedure enumeration is no longer supported (considering the low usage rate and it is not convenient to move values in different databases).
2: Cancel the "Generate Paging Stored Procedure" and "Generate Log Table" items in the one-time configuration, and the improvements are automatically generated internally in CYQ.Data V5 according to the actual situation.
3: Encoding mode, in addition to the enumeration type, also supports more than one Orm mode.
4: For the enumeration type encoding method, a cs file of TableNames.cs is finally generated; for the ORM mode, each table generates a corresponding entity class (table name.cs)
5: All configurations are automatically saved, and the latest changed configuration archive is the default configuration, which is convenient for the next change.
Through this improvement, plus the integration of external tools, it is quite convenient to use. Click on the "Generate File" button to update the field changes to the data.
Tool download:
In order to facilitate the special needs of the changes, this configuration tool, provide source code download.
Download address: http://www.cyqdata.com/download/article-detail-426
PS: The configuration tool CYQ.Data.ProjectTool is packaged and downloaded in the CYQ.Data V5 version framework. The source code of the configuration tool is provided separately for download.