Asp.net petapoco T4模板创建错误的poco
我正在尝试在我的asp.net网站中使用Petapoco。 下面是我的Database.ttAsp.net petapoco T4模板创建错误的poco,asp.net,petapoco,Asp.net,Petapoco,我正在尝试在我的asp.net网站中使用Petapoco。 下面是我的Database.tt // Settings ConnectionStringName = "Orgsetup"; // Uses last connection string in config if not specified Namespace = "namespace"; RepoName = "myrepoName"; SchemaName = "orgSchema"; GenerateOpera
// Settings
ConnectionStringName = "Orgsetup"; // Uses last connection string in config if not specified
Namespace = "namespace";
RepoName = "myrepoName";
SchemaName = "orgSchema";
GenerateOperations = true;
GeneratePocos = true;
GenerateCommon = true;
ClassPrefix = "";
ClassSuffix = "";
TrackModifiedColumns = true;
// Read schema
var tables = LoadTables();
// Generate output
if (tables.Count>0)
{
#>
<#@ include file="PetaPoco.Generator.ttinclude" #>
<# } #>
//设置
ConnectionStringName=“Orgsetup”//如果未指定,则使用配置中的最后一个连接字符串
Namespace=“Namespace”;
RepoName=“myrepoName”;
SchemaName=“orgSchema”;
GenerateOperations=true;
GeneratePocos=true;
GenerateCommon=true;
ClassPrefix=“”;
ClassSuffix=“”;
TrackModifiedColumns=true;
//读取模式
var tables=LoadTables();
//产生产出
如果(表计数>0)
{
#>
和在我的web.config中
<connectionStrings>
<add name="Orgsetup" connectionString="Datasource=localhost;Database=dp_usermgmt;uid=root;pwd=xxxxxx;"
providerName="MySql.Data.MySqlClient"/>
在运行了这个Database.tt之后,我得到了一个巨大的POCO类,其中包含服务器中所有数据库中的所有表
我正在为同一应用程序使用来自同一服务器的另外两个数据库。这两个数据库工作得非常好。。。
这是一个Mysql服务器5.5。
这有什么问题吗?我自己不要使用MySql,但有一个一般性提示,您确定连接字符串中的凭据有效吗?“我自己不要使用MySql”..请清除..凭据是正确的。其他两个连接字符串共享相同的凭据,并且工作正常。是否生成了一个空文件?是..大多数情况下,我得到的是空文件(带有一些标题注释).有时会产生很多建议…请让我兴奋起来…大多数时候我都是一片空白。cs