Class ColumnExpressionAttribute
Column expression attribute
Inherited Members
Namespace: XData.Mapping
Assembly: XData.docfx.dll
Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class ColumnExpressionAttribute : Attribute
Remarks
Used when ColumnAttribute value is expression (PlainSql or SubQuery) according ExprType
Constructors
| Improve this Doc View SourceColumnExpressionAttribute(String, String, DataExpressionType, DbType)
Column expression attribute
Declaration
public ColumnExpressionAttribute(string propertyName, string exprText, DataExpressionType exprType = DataExpressionType.PlainSql, DbType type = DbType.String)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | Property name |
String | exprText | Expression text |
DataExpressionType | exprType | Expression type |
DbType | type | Expression DbType |
Exceptions
Type | Condition |
---|---|
XDataRuntimeException | Property name cannot be null or empty string |
XDataRuntimeException | Expression text cannot be null or empty string |
Properties
| Improve this Doc View SourceDbType
Expression DbType
Declaration
public DbType DbType { get; }
Property Value
Type | Description |
---|---|
DbType |
Exists
Exists subquery operation
Declaration
public ExistsOperation Exists { get; set; }
Property Value
Type | Description |
---|---|
ExistsOperation |
ExprScale
Expression scale
Declaration
public int ExprScale { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
ExprSize
Expression size
Declaration
public int ExprSize { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
ExprText
Expression text
Declaration
public string ExprText { get; }
Property Value
Type | Description |
---|---|
String |
Remarks
PlainSql expression text is Sql expression or SqlExpressionAttribute name
SubQuery expression text is Alias
WARNING! Plain Sql expressions (see ExprType) can use specific Sql dialect features! Data mapping may be not compatible with other database engines! Use SqlExpressionAttribute instead.
ExprType
Expression type
Declaration
public DataExpressionType ExprType { get; }
Property Value
Type | Description |
---|---|
DataExpressionType |
Remarks
WARNING! Plain Sql expressions can use specific Sql dialect features! Data mapping may be not compatible with other database engines!
See Also
| Improve this Doc View SourcePropertyName
Property name
Declaration
public string PropertyName { get; }
Property Value
Type | Description |
---|---|
String |
See Also
| Improve this Doc View SourceTypeId
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. |