.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

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
<AttributeUsage(AttributeTargets.Property, Inherited:=True)>
Public Class CalculatedAttribute
    Inherits Attribute
[AttributeUsage(AttributeTargets.Property, Inherited = true)]
public class CalculatedAttribute :
    Attribute
<AttributeUsage(AttributeTargets.Property, Inherited:=True)>
Public Class CalculatedAttribute
    Inherits Attribute
[AttributeUsage(AttributeTargets.Property, Inherited = true)]
public class CalculatedAttribute :
    Attribute
<AttributeUsage(AttributeTargets.Property, Inherited:=True)>
Public Class CalculatedAttribute
    Inherits 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