TransientAttribute
This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.
Use TransientBehaviorAttribute to mark a persistent class or a member of a persistent class that should not have corresponding database representation. One TransientBehaviorAttribute is specified per class\property\field.
[Table( "Persons" )]
public class Person
{
[Transient]
protected string nonOa;
public string NotOpenAccessProperty
{
get
{
return nonOa;
}
}
}
<Table("Persons")>
Public Class Person
<Transient>
Protected nonOa As String
Public ReadOnly Property NotOpenAccessProperty() As String
Get
Return nonOa
End Get
End Property
End Class
It is important to understand when the TransientBehaviorAttribute should be used. It could be specified per class, property or field. If any attribute is omitted, then the target element won't be considered as non-persistend. Instead, it will be mapped to a database element with the same name. When you specify the PersistentNamespaceAttribute for a namespace it will mark all classes inside that namespace as persistent. So if you want to instruct the Telerik Data Access engine to assume a class to be non-persistent, the class should be marked with the TransientBehaviorAttribute.