itdos / dos.tool Goto Github PK
View Code? Open in Web Editor NEW实体生成工具
License: MIT License
实体生成工具
License: MIT License
https://github.com/itdos/Dos.Tool/blob/master/DbDAL/MySql/DbObject.cs#L718
实际上在mysql中执行SHOW FULL COLUMNS FROM {0}
,返回的数据(举例)是这样的。
Field---Type---Collation---Null---Key---Default---Extra---Privileges---comment
id int(11) NO PRI auto_increment select,insert,update,references
uid int(11) YES select,insert,update,references
oname varchar(50) utf8_general_ci YES select,insert,update,references
ocode varchar(30) utf8_general_ci YES select,insert,update,references
Comment全部为空。
但是有一个Extra列中id为auto_increment,因此,通过Extra可以得知id为自增字段。
DbDAL/MySql/DbObject.cs#L718 实际上是取Comment列为auto_increment,导致生成的实体没有GetIdentityField()的实现,插入数据后,GetIdentityField()返回null,也就导致后面取不到自增ID。
所以,718行应该改为
if (reader["Extra"].ToString().Trim() == "auto_increment")
{
dr["IsIdentity"] = "√";
}
经修改后,数据测试正常!
环境:mysql 5.7.10-log 、.Net 4.5
你好,我用了您的Dos.Pangu.Dll,目前需要自定义词典导入,但是好像Dos.Pangu项目只能把字典当做嵌入资源使用,所以在没有源码的情况下我不能实现编译,找了JimLiu的Pangu项目,但是由于命名空间过多不好更改,所以在这个issue里,请问能够提供Dos.Pangu的项目下载呢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.