EldorADO.NET Class Library

ObjectContext Class

[This is preliminary documentation and subject to change.]

An object serving as a bridge between a LocalStorage and one or several RemoteSources.

For a list of all members of this type, see ObjectContext Members.

System.Object
   MarshalByRefObject
      Component
         ObjectContext

[Visual Basic]
<DesignerCategory(Category="Component")>
Public Class ObjectContext
Inherits Component
Implements IServiceProvider
[C#]
[DesignerCategory(Category="Component")]
public class ObjectContext : Component, IServiceProvider

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

An ObjectContext object serves as a starting point in the class library.

Example

A possible way to instantiate a new object context on a SQL server database may look like this:

using Eldorado.Object;
using Eldorado.Object.Relational;
using Eldorado.Relational.RelationalSource;
 
public ObjectContext CreateContext(string connectionString, string domain)
{
    DataSetObjectStorage localStorage = new DataSetObjectStorage();
    localStorage.RootDomain = domain;
 
    SqlObjectSource remoteSource = new SqlObjectSource();
    remoteSource.ConnectionString = connectionString;
    remoteSource.RootDomain = domain;
 
    ObjectContext result = new ObjectContext();
    result.Domain = domain;
    result.LocalStorage = localStorage;
    result.RemoteSources.Add(remoteSource);
    return result;
}
 

Requirements

Namespace: Eldorado.Object.Disconnected

Assembly: Eldorado.Object (in Eldorado.Object.dll)

See Also

ObjectContext Members | Eldorado.Object.Disconnected Namespace