Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

CalculatedAttribute Class

Applied to business class properties. Specifies an expression used to calculate the target property value in the Data View mode.

Namespace: DevExpress.ExpressApp.DC

Assembly: DevExpress.ExpressApp.v19.2.dll

Declaration

[AttributeUsage(AttributeTargets.Property, Inherited = true)]
public class CalculatedAttribute :
    Attribute

Remarks

Below is an example of using the CalculatedAttribute.

using DevExpress.ExpressApp.DC;
// ...
public class Person {    
    // ...
    public String FirstName { get; set; }
    public String LastName { get; set; }
    [Calculated("FirstName + ' ' + LastName")]
    public String FullName {
        get {
            return FirstName + " " + LastName;
        }
    }
}

Properties, used in the CalculatedAttribute.Expression should be persistent to be able to run an SQL query at the database level.

Inheritance

Object
Attribute
CalculatedAttribute
See Also