This commit is contained in:
sunkaixuan 2017-05-12 21:18:26 +08:00
parent 158829460f
commit 5ad323e993

View File

@ -338,6 +338,34 @@ namespace SqlSugar
return mappingInfo.DbTableName; return mappingInfo.DbTableName;
} }
} }
internal string GetEntityName(string tableName)
{
if (this.MappingTables == null || this.MappingTables.Count == 0) return tableName;
else
{
var mappingInfo = this.MappingTables.SingleOrDefault(it => it.DbTableName == tableName);
return mappingInfo.EntityName;
}
}
internal string GetDbColumnName<T>(string entityNam)
{
var typeName = typeof(T).Name;
if (this.MappingTables == null || this.MappingTables.Count == 0) return typeName;
else
{
var mappingInfo = this.MappingTables.SingleOrDefault(it => it.EntityName == typeName);
return mappingInfo.DbTableName;
}
}
internal string GetEntityPropertyName(string bbColumnName)
{
if (this.MappingTables == null || this.MappingTables.Count == 0) return tableName;
else
{
var mappingInfo = this.MappingTables.SingleOrDefault(it => it.DbTableName == tableName);
return mappingInfo.EntityName;
}
}
#endregion #endregion
} }
} }