Class ColumnAttribute
Column mapping attribute
Inherited Members
Namespace: XData.Mapping
Assembly: XData.docfx.dll
Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class ColumnAttribute : Attribute
Remarks
Used to map data without declaring real property
This useful for declare Id, introduce "virtual" property for PropertyName, ChildProperty or can be used for grouping (see GroupOrder)
Constructors
| Improve this Doc View SourceColumnAttribute(String, Type, String, String)
Column attribute
Declaration
public ColumnAttribute(string propertyName, Type propertyType, string source = "", string fieldName = "")
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | Property name |
Type | propertyType | Property type |
String | source | Source alias |
String | fieldName | Field name |
Exceptions
Type | Condition |
---|---|
XDataRuntimeException | Property name cannot be null or empty string |
XDataRuntimeException | Field name cannot be null or empty string |
XDataRuntimeException | Property type cannot be null |
Properties
| Improve this Doc View SourceFieldName
Field name
Declaration
public string FieldName { get; }
Property Value
Type | Description |
---|---|
String |
Flags
Property flags
Declaration
public DataPropertyFlag Flags { get; set; }
Property Value
Type | Description |
---|---|
DataPropertyFlag |
See Also
| Improve this Doc View SourceGrouping
Grouping mode
Declaration
public DataGrouping Grouping { get; set; }
Property Value
Type | Description |
---|---|
DataGrouping |
See Also
| Improve this Doc View SourceGroupOrder
Grouping order
Declaration
public int GroupOrder { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Hidden
Hidden column flag
Declaration
public bool Hidden { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
Used to exclude column from query selected columns
Hidden column can be used as: PropertyName, ChildProperty or for grouping (see GroupOrder)
NativeSqlType
Native SQL type name
Declaration
public string NativeSqlType { get; set; }
Property Value
Type | Description |
---|---|
String |
Remarks
Used to specify native SQL column type when conflicted with default type mapping
WARNING! May be not supported by database adapter!
OrderBy
Order by priority
Declaration
public int OrderBy { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
OrderByDesc
Order by desc flag
Declaration
public bool OrderByDesc { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
PropertyName
Property name
Declaration
public string PropertyName { get; }
Property Value
Type | Description |
---|---|
String |
PropertyType
Property type
Declaration
public Type PropertyType { get; }
Property Value
Type | Description |
---|---|
Type |
Reference
Referenced property name
Declaration
public string Reference { get; set; }
Property Value
Type | Description |
---|---|
String |
ReferenceSource
Referenced property source alias
Declaration
public string ReferenceSource { get; set; }
Property Value
Type | Description |
---|---|
String |
Source
Data source alias
Declaration
public string Source { get; }
Property Value
Type | Description |
---|---|
String |
TypeId
When implemented in a derived class, gets a unique identifier for this Attribute.
Declaration
public override object TypeId { get; }
Property Value
Type | Description |
---|---|
Object | An Object that is a unique identifier for the attribute. |