Expression Property
Collapse the table of content
Expand the table of content

ColumnAttribute.Expression Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets whether a column is a computed column in a database.

Namespace:  System.Data.Linq.Mapping
Assembly:  System.Data.Linq (in System.Data.Linq.dll)

public string Expression { get; set; }

Property Value

Type: System.String
Default = empty.

Use this property when you use CreateDatabase to define a column as containing computed values.

For example, if you want to create a column defined in SQL as InventoryVal AS UnitPrice * UnitsInStock, use the following expression string: "UnitPrice * UnitsInStock".

NoteNote:

LINQ to SQL does not support computed columns as primary keys.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft