Holds one single object that is connected with the parent object.
Object Model
Syntax
| Visual Basic (Declaration) | |
|---|
Public NotInheritable Class ObjectHolder(Of T)
Inherits ObjectHolderBase |
| Visual Basic (Usage) | Copy Code |
|---|
Dim instance As ObjectHolder(Of T)
|
| Managed Extensions for C++ | |
|---|
public __gc __sealed class ObjectHolder<T> : public ObjectHolderBase |
| C++/CLI | |
|---|
generic<typename T>
public ref class ObjectHolder sealed : public ObjectHolderBase |
Type Parameters
Example
The following example shows how to use the ObjectHolder in your persistent objects. In the
example each Call has one associated User.
| C# | Copy Code |
|---|
[Persistent("CALLS", PoolSize = 20)] public class Call { // The class contains an ObjectHolder and a <see cref="T:Chili.Opf3.Relations.RelationAttribute">RelationAttribute</see> // that specifies the relation between the parent object and the // related objects. [Relation("UserId", "Id", SaveOrder = SaveOrders.ChildFirst)] private ObjectHolder<User> _user = new ObjectHolder<User>(); // The User property accesses the InnerObject property to get // the User object or to set a new one. public User User { get { return _user.InnerObject; } set { _user.InnerObject = value; } } // ... Other properties and code. } |
Remarks
Inheritance Hierarchy
Requirements
Namespace: Chili.Opf3.Relations
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Assembly: Chili.Opf3 (in Chili.Opf3.dll)
See Also