Allows to specify the depth of the
loaded object graph that is
persisted during the save process.
Syntax
| Visual Basic (Declaration) | |
|---|
Public Enum PersistDepths
Inherits Enum |
| C# | |
|---|
public enum PersistDepths : Enum |
| Managed Extensions for C++ | |
|---|
__value public enum PersistDepths : public Enum |
| C++/CLI | |
|---|
public enum class PersistDepths : public Enum |
Members
Example
The following example shows you how to use the enumeration while saving persistent
objects.
| C# | Copy Code |
|---|
// Create a storage and the context. OleDbStorage storage = new OleDbStorage("connectionstring ..."); ObjectContext context = new ObjectContext(storage); // Load the user with the Id '1'. User user = context.GetObject<User>("Id = {0}", "1"); if (user != null) { // Get the calls of the user. The calls are only loaded // during the first request of the property (delayed loading). ObjectSet<Call> calls = user.Calls; } // Save the user object. Since flat is used only the object // without the calls is saved. context.PersistChanges(user, PersistDepth.Flat); // Save the user object. Using FirstLevel means that the object // itself plus the calls are saved. If each call would contain // another connected object or collection that wouldn't be saved. context.PersistChanges(user, PersistDepth.FirstLevel); |
Remarks
Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
Chili.Opf3.PersistDepths
Requirements
Namespace: Chili.Opf3
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