Table of Contents

Class DynamicColumnAccessorAttribute

Namespace
LinqToDB.Mapping
Assembly
linq2db.dll

Configure setter and getter methods for dynamic columns.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class DynamicColumnAccessorAttribute : MappingAttribute, _Attribute
Inheritance
DynamicColumnAccessorAttribute
Implements
Inherited Members
Extension Methods

Remarks

Expected signatures for getter and setter:

// should return true and value of property, if property value found in storage
// should return false if property value not found in storage
static object Getter(Entity object, string propertyName, object defaultValue);
// or
object this.Getter(string propertyName, object defaultValue);
// where defaultValue is default value for property type for current MappingSchema

static void Setter(Entity object, string propertyName, object value)
or
void this.Setter(string propertyName, object value)

Properties

GetterExpression

Gets or sets name of dynamic properties property get expression.

public LambdaExpression? GetterExpression { get; set; }

Property Value

LambdaExpression

GetterExpressionMethod

Gets or sets name of dynamic properties property getter expression method or property. Method or property must be static.

public string? GetterExpressionMethod { get; set; }

Property Value

string

GetterMethod

Gets or sets name of dynamic properties property getter method.

public string? GetterMethod { get; set; }

Property Value

string

SetterExpression

Gets or sets name of dynamic properties property set expression.

public LambdaExpression? SetterExpression { get; set; }

Property Value

LambdaExpression

SetterExpressionMethod

Gets or sets name of dynamic properties property setter expression method or property. Method or property must be static.

public string? SetterExpressionMethod { get; set; }

Property Value

string

SetterMethod

Gets or sets name of dynamic properties property setter method.

public string? SetterMethod { get; set; }

Property Value

string

Methods

GetObjectID()

Returns mapping attribute id, based on all attribute options.

public override string GetObjectID()

Returns

string

Validate()

protected void Validate()

See Also