DBToEntitys 使用T4模板生成Entitys 首先,从GitHub上获取代码( https://github.com/zhifengfly/DBToEntitys.git ), 然后打开解决方案,修改《DBHelper.ttinclude》文件中的数据库链接字符串 和 Entity 的命名空间,如下图所示 最后打开《EntityAutoGenerator.tt》文件,保存一下即可生成实体类文件。