-
Notifications
You must be signed in to change notification settings - Fork 1.3k
9.EntityMain
SherryShi0108 edited this page Nov 5, 2021
·
6 revisions
Getting Entity Information
var entityInfo=db.EntityMaintenance.GetEntityInfo<Student>();
foreach (var column in entityInfo.Columns)
{
Console.WriteLine(column.ColumnDescription);
}
[SugarTable("dbo.STudent")]
public class Student
{
[SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "StudentID",ColumnDescription ="主键")]
public int Id { get; set; }
public string Name { get; set; }
}
name | description | return type |
---|---|---|
GetEntityInfo | Get entity information | EntityInfo |
GetTableName | Get table name by entity | string |
GetEntityName | Get entity name by entity | string |
GetDbColumnName | Get Db column name by property name | string |
GetPropertyName | Get Db property name by Db column name | string |
GetProperty | Get property by Db column name | PropertyInfo |