-
Notifications
You must be signed in to change notification settings - Fork 1.3k
9.EntityMain
果糖网 edited this page Jul 23, 2024
·
7 revisions
Getting Entity Information
var entityInfo=db.EntityMaintenance.GetEntityInfo<Student>();
foreach (var column in entityInfo.Columns)
{
Console.WriteLine(column.ColumnDescription);//Read only Do not modify
}
[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 |