Table of Contents

Class ColumnAliasAttribute

Namespace
LinqToDB.Mapping
Assembly
linq2db.dll

Specifies that current field or property is just an alias to another property or field. Currently this attribute has several issues:

  • you can apply it to class or interface - such attribute will be ignored by linq2db;
  • it is possible to define attribute without setting MemberName value;
  • you can define alias to another alias property or field and potentially create loop.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = true, Inherited = true)]
public class ColumnAliasAttribute : MappingAttribute, _Attribute
Inheritance
ColumnAliasAttribute
Implements
Inherited Members
Extension Methods

Constructors

ColumnAliasAttribute()

Use ColumnAliasAttribute(string) constructor or specify MemberName value.

public ColumnAliasAttribute()

ColumnAliasAttribute(string)

Creates attribute instance.

public ColumnAliasAttribute(string memberName)

Parameters

memberName string

Name of target property or field.

Properties

MemberName

Gets or sets the name of target property or field.

public string? MemberName { get; set; }

Property Value

string

Methods

GetObjectID()

Returns mapping attribute id, based on all attribute options.

public override string GetObjectID()

Returns

string