C# Class FrameDAL.Utility.ReflectionExtensions

Afficher le fichier Open project: vincentlauvlwj/FrameDAL

Méthodes publiques

Méthode Description
GetCachedProperties ( this type ) : System.Reflection.PropertyInfo[]

从缓存中获得类的所有属性

GetColumnAttribute ( this prop ) : ColumnAttribute

从缓存中获取属性的Column特性类对象

GetIdAttribute ( this prop ) : IdAttribute

从缓存中获取属性的Id特性类对象

GetIdProperty ( this type ) : PropertyInfo

从缓存中获取类的ID属性,ID属性是指添加了Id特性的属性

GetManyToManyAttribute ( this prop ) : ManyToManyAttribute
GetManyToOneAttribute ( this prop ) : ManyToOneAttribute
GetOneToManyAttribute ( this prop ) : OneToManyAttribute
GetTableAttribute ( this type ) : TableAttribute

获取缓存中的Table特性类对象

GetValue ( this member, object instance ) : object
SetValue ( this member, object instance, object value ) : void
SetValueSafely ( this prop, object entity, object value ) : void

安全设置实体属性的值

Method Details

GetCachedProperties() public static méthode

从缓存中获得类的所有属性
type为null 该类中没有任何公开属性
public static GetCachedProperties ( this type ) : System.Reflection.PropertyInfo[]
type this 要获取属性的类
Résultat System.Reflection.PropertyInfo[]

GetColumnAttribute() public static méthode

从缓存中获取属性的Column特性类对象
type为null 该属性的Column特性没有正确配置
public static GetColumnAttribute ( this prop ) : ColumnAttribute
prop this 要获取特性的属性
Résultat FrameDAL.Attributes.ColumnAttribute

GetIdAttribute() public static méthode

从缓存中获取属性的Id特性类对象
type为null 该属性的Id特性没有正确配置
public static GetIdAttribute ( this prop ) : IdAttribute
prop this 要获取特性的属性
Résultat FrameDAL.Attributes.IdAttribute

GetIdProperty() public static méthode

从缓存中获取类的ID属性,ID属性是指添加了Id特性的属性
该类没有配置ID属性 type为null 该类的Id特性没有正确配置
public static GetIdProperty ( this type ) : PropertyInfo
type this 要获取ID属性的类
Résultat System.Reflection.PropertyInfo

GetManyToManyAttribute() public static méthode

public static GetManyToManyAttribute ( this prop ) : ManyToManyAttribute
prop this
Résultat FrameDAL.Attributes.ManyToManyAttribute

GetManyToOneAttribute() public static méthode

public static GetManyToOneAttribute ( this prop ) : ManyToOneAttribute
prop this
Résultat FrameDAL.Attributes.ManyToOneAttribute

GetOneToManyAttribute() public static méthode

public static GetOneToManyAttribute ( this prop ) : OneToManyAttribute
prop this
Résultat FrameDAL.Attributes.OneToManyAttribute

GetTableAttribute() public static méthode

获取缓存中的Table特性类对象
该类没有添加Table特性,或者Table.Name属性为空或空白字符串 type为null
public static GetTableAttribute ( this type ) : TableAttribute
type this 要获取特性的类
Résultat FrameDAL.Attributes.TableAttribute

GetValue() public static méthode

public static GetValue ( this member, object instance ) : object
member this
instance object
Résultat object

SetValue() public static méthode

public static SetValue ( this member, object instance, object value ) : void
member this
instance object
value object
Résultat void

SetValueSafely() public static méthode

安全设置实体属性的值
public static SetValueSafely ( this prop, object entity, object value ) : void
prop this 属性
entity object 要设置属性值的实体
value object
Résultat void