C# Класс FrameDAL.Utility.ReflectionExtensions

Показать файл Открыть проект

Открытые методы

Метод Описание
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

安全设置实体属性的值

Описание методов

GetCachedProperties() публичный статический Метод

从缓存中获得类的所有属性
type为null 该类中没有任何公开属性
public static GetCachedProperties ( this type ) : System.Reflection.PropertyInfo[]
type this 要获取属性的类
Результат System.Reflection.PropertyInfo[]

GetColumnAttribute() публичный статический Метод

从缓存中获取属性的Column特性类对象
type为null 该属性的Column特性没有正确配置
public static GetColumnAttribute ( this prop ) : ColumnAttribute
prop this 要获取特性的属性
Результат FrameDAL.Attributes.ColumnAttribute

GetIdAttribute() публичный статический Метод

从缓存中获取属性的Id特性类对象
type为null 该属性的Id特性没有正确配置
public static GetIdAttribute ( this prop ) : IdAttribute
prop this 要获取特性的属性
Результат FrameDAL.Attributes.IdAttribute

GetIdProperty() публичный статический Метод

从缓存中获取类的ID属性,ID属性是指添加了Id特性的属性
该类没有配置ID属性 type为null 该类的Id特性没有正确配置
public static GetIdProperty ( this type ) : PropertyInfo
type this 要获取ID属性的类
Результат System.Reflection.PropertyInfo

GetManyToManyAttribute() публичный статический Метод

public static GetManyToManyAttribute ( this prop ) : ManyToManyAttribute
prop this
Результат FrameDAL.Attributes.ManyToManyAttribute

GetManyToOneAttribute() публичный статический Метод

public static GetManyToOneAttribute ( this prop ) : ManyToOneAttribute
prop this
Результат FrameDAL.Attributes.ManyToOneAttribute

GetOneToManyAttribute() публичный статический Метод

public static GetOneToManyAttribute ( this prop ) : OneToManyAttribute
prop this
Результат FrameDAL.Attributes.OneToManyAttribute

GetTableAttribute() публичный статический Метод

获取缓存中的Table特性类对象
该类没有添加Table特性,或者Table.Name属性为空或空白字符串 type为null
public static GetTableAttribute ( this type ) : TableAttribute
type this 要获取特性的类
Результат FrameDAL.Attributes.TableAttribute

GetValue() публичный статический Метод

public static GetValue ( this member, object instance ) : object
member this
instance object
Результат object

SetValue() публичный статический Метод

public static SetValue ( this member, object instance, object value ) : void
member this
instance object
value object
Результат void

SetValueSafely() публичный статический Метод

安全设置实体属性的值
public static SetValueSafely ( this prop, object entity, object value ) : void
prop this 属性
entity object 要设置属性值的实体
value object
Результат void