ManagedContext constructor Null safety

ManagedContext(
  1. ManagedDataModel? dataModel,
  2. PersistentStore persistentStore
)

Creates an instance of ManagedContext from a ManagedDataModel and PersistentStore.

This is the default constructor.

A Query is sent to the database described by persistentStore. A Query may only be executed on this context if its type is in dataModel.

Implementation

ManagedContext(this.dataModel, this.persistentStore) {
  mm.add(dataModel!);
  _finalizer.attach(this, persistentStore, detach: this);
}