private EphorteContext( Func <IObjectModelAdapter, NcoreVersion, IStateManager> createStateManager, // Workaround to be able to instantiate a statemanager with a different IQueryProvider IObjectModelAdapter objectModelAdapter, IFunctionsAdapter functionsAdapter, IDocumentsAdapter documentsAdapter, IMetadataAdapter metadataAdapter, NcoreVersion ncoreVersion ) { NcoreVersion = ncoreVersion ?? NcoreVersion.Configured; if (objectModelAdapter != null) { _stateManager = createStateManager(objectModelAdapter, NcoreVersion); _objectModelAdapter = objectModelAdapter; } if (functionsAdapter != null) { _functionManager = new FunctionManager(functionsAdapter); } if (documentsAdapter != null) { _documentManager = new DocumentManager(documentsAdapter); } if (metadataAdapter != null) { _metadataManager = new MetadataManager(metadataAdapter); } }
public EphorteContext( IAsyncObjectModelAdapter asyncObjectModelAdapter = null, IAsyncFunctionsAdapter asyncfunctionsAdapter = null, IAsyncDocumentsAdapter asyncDocumentsAdapter = null, IAsyncMetadataAdapter asyncMetadataAdapter = null, NcoreVersion ncoreVersion = null ) : this(CreateAsyncStateManager, asyncObjectModelAdapter, asyncfunctionsAdapter, asyncDocumentsAdapter, asyncMetadataAdapter, ncoreVersion) { if (asyncObjectModelAdapter != null) { _asyncObjectModelAdapter = asyncObjectModelAdapter; } if (asyncfunctionsAdapter != null) { _asyncFunctionManager = new AsyncFunctionManager(asyncfunctionsAdapter); } if (asyncDocumentsAdapter != null) { _asyncDocumentManager = new AsyncDocumentManager(asyncDocumentsAdapter); } if (asyncMetadataAdapter != null) { _asyncMetadataManager = new AsyncMetadataManager(asyncMetadataAdapter); } }
public EphorteContext( IObjectModelAdapter objectModelAdapter = null, IFunctionsAdapter functionsAdapter = null, IDocumentsAdapter documentsAdapter = null, IMetadataAdapter metadataAdapter = null, NcoreVersion ncoreVersion = null ) : this(CreateStateManager, objectModelAdapter, functionsAdapter, documentsAdapter, metadataAdapter, ncoreVersion) { }
private static StateManager CreateAsyncStateManager(IObjectModelAdapter objectModelAdapter, NcoreVersion ncoreVersion) { return(objectModelAdapter == null ? null : new StateManager(@this => new AsyncDataObjectQueryProvider(@this, (IAsyncObjectModelAdapter)objectModelAdapter, ncoreVersion))); }