Table of Contents

Class DynamicColumnInfo

Namespace
LinqToDB.Mapping
Assembly
linq2db.dll

Discovers the attributes of a property and provides access to property metadata.

public class DynamicColumnInfo : PropertyInfo, ICustomAttributeProvider, _MemberInfo, _PropertyInfo, IEquatable<DynamicColumnInfo>
Inheritance
DynamicColumnInfo
Implements
Inherited Members
Extension Methods

Constructors

DynamicColumnInfo(Type, Type, string)

Initializes a new instance of the DynamicColumnInfo class.

public DynamicColumnInfo(Type declaringType, Type columnType, string memberName)

Parameters

declaringType Type

Type of the declaring.

columnType Type

Type of the column.

memberName string

Name of the member.

Properties

Attributes

Gets the attributes for this property.

public override PropertyAttributes Attributes { get; }

Property Value

PropertyAttributes

Attributes of this property.

CanRead

Gets a value indicating whether the property can be read.

public override bool CanRead { get; }

Property Value

bool

true if this property can be read; otherwise, false.

CanWrite

Gets a value indicating whether the property can be written to.

public override bool CanWrite { get; }

Property Value

bool

true if this property can be written to; otherwise, false.

DeclaringType

Gets the class that declares this member.

public override Type DeclaringType { get; }

Property Value

Type

The Type object for the class that declares this member.

Name

Gets the name of the current member.

public override string Name { get; }

Property Value

string

A string containing the name of this member.

PropertyType

Gets the type of this property.

public override Type PropertyType { get; }

Property Value

Type

The type of this property.

ReflectedType

Gets the class object that was used to obtain this instance of MemberInfo.

public override Type ReflectedType { get; }

Property Value

Type

The Type object through which this MemberInfo object was obtained.

Methods

Equals(DynamicColumnInfo?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(DynamicColumnInfo? other)

Parameters

other DynamicColumnInfo

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Returns a value that indicates whether this instance is equal to a specified object.

public override bool Equals(object? obj)

Parameters

obj object

An object to compare with this instance, or null.

Returns

bool

true if obj equals the type and value of this instance; otherwise, false.

GetAccessors(bool)

Returns an array whose elements reflect the public and, if specified, non-public get, set, and other accessors of the property reflected by the current instance.

public override MethodInfo[] GetAccessors(bool nonPublic)

Parameters

nonPublic bool

Indicates whether non-public methods should be returned in the MethodInfo array. true if non-public methods are to be included; otherwise, false.

Returns

MethodInfo[]

An array of MethodInfo objects whose elements reflect the get, set, and other accessors of the property reflected by the current instance. If nonPublic is true, this array contains public and non-public get, set, and other accessors. If nonPublic is false, this array contains only public get, set, and other accessors. If no accessors with the specified visibility are found, this method returns an array with zero (0) elements.

GetCustomAttributes(bool)

When overridden in a derived class, returns an array of all custom attributes applied to this member.

public override object[] GetCustomAttributes(bool inherit)

Parameters

inherit bool

true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.

Returns

object[]

An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined.

Exceptions

InvalidOperationException

This member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context.

TypeLoadException

A custom attribute type could not be loaded.

GetCustomAttributes(Type, bool)

When overridden in a derived class, returns an array of custom attributes applied to this member and identified by Type.

public override object[] GetCustomAttributes(Type attributeType, bool inherit)

Parameters

attributeType Type

The type of attribute to search for. Only attributes that are assignable to this type are returned.

inherit bool

true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.

Returns

object[]

An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to attributeType have been applied.

Exceptions

TypeLoadException

A custom attribute type cannot be loaded.

ArgumentNullException

If attributeType is null.

InvalidOperationException

This member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context.

GetCustomAttributesData()

Returns a list of CustomAttributeData objects representing data about the attributes that have been applied to the target member.

public override IList<CustomAttributeData> GetCustomAttributesData()

Returns

IList<CustomAttributeData>

A generic list of CustomAttributeData objects representing data about the attributes that have been applied to the target member.

GetGetMethod(bool)

When overridden in a derived class, returns the public or non-public get accessor for this property.

public override MethodInfo GetGetMethod(bool nonPublic)

Parameters

nonPublic bool

Indicates whether a non-public get accessor should be returned. true if a non-public accessor is to be returned; otherwise, false.

Returns

MethodInfo

A MethodInfo object representing the get accessor for this property, if nonPublic is true. Returns null if nonPublic is false and the get accessor is non-public, or if nonPublic is true but no get accessors exist.

Exceptions

SecurityException

The requested method is non-public and the caller does not have ReflectionPermission to reflect on this non-public method.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer hash code.

GetIndexParameters()

When overridden in a derived class, returns an array of all the index parameters for the property.

public override ParameterInfo[] GetIndexParameters()

Returns

ParameterInfo[]

An array of type ParameterInfo containing the parameters for the indexes. If the property is not indexed, the array has 0 (zero) elements.

GetSetMethod(bool)

When overridden in a derived class, returns the set accessor for this property.

public override MethodInfo GetSetMethod(bool nonPublic)

Parameters

nonPublic bool

Indicates whether the accessor should be returned if it is non-public. true if a non-public accessor is to be returned; otherwise, false.

Returns

MethodInfo

Value Condition A MethodInfo object representing the Set method for this property. The set accessor is public.-or- nonPublic is true and the set accessor is non-public. nullnonPublic is true, but the property is read-only.-or- nonPublic is false and the set accessor is non-public.-or- There is no set accessor.

Exceptions

SecurityException

The requested method is non-public and the caller does not have ReflectionPermission to reflect on this non-public method.

GetValue(object?, BindingFlags, Binder?, object?[]?, CultureInfo?)

When overridden in a derived class, returns the property value of a specified object that has the specified binding, index, and culture-specific information.

public override object GetValue(object? obj, BindingFlags invokeAttr, Binder? binder, object?[]? index, CultureInfo? culture)

Parameters

obj object

The object whose property value will be returned.

invokeAttr BindingFlags

A bitwise combination of the following enumeration members that specify the invocation attribute: InvokeMethod, CreateInstance, Static, GetField, SetField, GetProperty, and SetProperty. You must specify a suitable invocation attribute. For example, to invoke a static member, set the Static flag.

binder Binder

An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects through reflection. If binder is null, the default binder is used.

index object[]

Optional index values for indexed properties. This value should be null for non-indexed properties.

culture CultureInfo

The culture for which the resource is to be localized. If the resource is not localized for this culture, the Parent property will be called successively in search of a match. If this value is null, the culture-specific information is obtained from the CurrentUICulture property.

Returns

object

The property value of the specified object.

Exceptions

ArgumentException

The index array does not contain the type of arguments needed.-or- The property's get accessor is not found.

TargetException

The object does not match the target type, or a property is an instance property but obj is null.

TargetParameterCountException

The number of parameters in index does not match the number of parameters the indexed property takes.

MethodAccessException

There was an illegal attempt to access a private or protected method inside a class.

TargetInvocationException

An error occurred while retrieving the property value. For example, an index value specified for an indexed property is out of range. The InnerException property indicates the reason for the error.

IsDefined(Type, bool)

When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member.

public override bool IsDefined(Type attributeType, bool inherit)

Parameters

attributeType Type

The type of custom attribute to search for. The search includes derived types.

inherit bool

true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.

Returns

bool

true if one or more instances of attributeType or any of its derived types is applied to this member; otherwise, false.

SetValue(object?, object?, BindingFlags, Binder?, object?[]?, CultureInfo?)

When overridden in a derived class, sets the property value for a specified object that has the specified binding, index, and culture-specific information.

public override void SetValue(object? obj, object? value, BindingFlags invokeAttr, Binder? binder, object?[]? index, CultureInfo? culture)

Parameters

obj object

The object whose property value will be set.

value object

The new property value.

invokeAttr BindingFlags

A bitwise combination of the following enumeration members that specify the invocation attribute: InvokeMethod, CreateInstance, Static, GetField, SetField, GetProperty, or SetProperty. You must specify a suitable invocation attribute. For example, to invoke a static member, set the Static flag.

binder Binder

An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects through reflection. If binder is null, the default binder is used.

index object[]

Optional index values for indexed properties. This value should be null for non-indexed properties.

culture CultureInfo

The culture for which the resource is to be localized. If the resource is not localized for this culture, the Parent property will be called successively in search of a match. If this value is null, the culture-specific information is obtained from the CurrentUICulture property.

Exceptions

ArgumentException

The index array does not contain the type of arguments needed.-or- The property's set accessor is not found.

TargetException

The object does not match the target type, or a property is an instance property but obj is null.

TargetParameterCountException

The number of parameters in index does not match the number of parameters the indexed property takes.

MethodAccessException

There was an illegal attempt to access a private or protected method inside a class.

TargetInvocationException

An error occurred while setting the property value. For example, an index value specified for an indexed property is out of range. The InnerException property indicates the reason for the error.

Operators

operator ==(DynamicColumnInfo?, DynamicColumnInfo?)

Implements the operator ==.

public static bool operator ==(DynamicColumnInfo? a, DynamicColumnInfo? b)

Parameters

a DynamicColumnInfo

a.

b DynamicColumnInfo

The b.

Returns

bool

The result of the operator.

operator !=(DynamicColumnInfo?, DynamicColumnInfo?)

Implements the operator !=.

public static bool operator !=(DynamicColumnInfo? a, DynamicColumnInfo? b)

Parameters

a DynamicColumnInfo

a.

b DynamicColumnInfo

The b.

Returns

bool

The result of the operator.