Click or drag to resize
weroSoft AG, Software
IManagedContext Interface
The documentation is integral part of the weroSoft product documentation. This part is intended to be used by developers only.
Defines an interface used to implement a managed contexts like it is provided by the entity framework of .NET.

Namespace:  WeroSoft.Serialization
Assembly:  WeroSoft.Core.Library (in WeroSoft.Core.Library.dll) Version: 3.0 Pre-Release
Syntax
C#
public interface IManagedContext
Remarks
Implement this interface on own partial part of the generated context class of entity framework.
Examples
// Own partial of the generated context of the entity framework.
public partial class PrimaryDatastoreContext : IManagedContext
{
    // Implements the disposing event like it is defined in the interface IManagedContext.
    public event EventHandler Disposing = delegate { };

    // Called on disposing the context.
    protected override void Dispose(Boolean disposing)
    {
        base.Dispose(disposing);

        // Raise the event to dispose the context
        Disposing(this, new EventArgs());
    }
}

The IManagedContext type exposes the following members.

Events
  NameDescription
Public eventDisposing
Declares the event which is raised on disposing the context.
Public eventObjectMaterialized
Declares the event which is called on materialization the context.
Public eventSavingChanges
Declares the event which is raised on saving data within the context.
Top
See Also