// TODO: Get rid of this constructor. public ClrMappedDSP(IDoCRUD <T> dataAccessLayerSimple, BetterLCVCreatorDelegate <T> betterLCVCreatorDelegate /*, bool isAsynchronous*/) { _dataAccessLayerSimple = dataAccessLayerSimple; if (dataAccessLayerSimple is IDoCrudWithMapping <T> dalWithMapping) { _dataAccessLayerWithMapping = dalWithMapping; } _betterLCVCreatorDelegate = betterLCVCreatorDelegate; //IsAsynchronous = isAsynchronous; dataAccessLayerSimple.DataSourceChanged += _dataAccessLayer_DataSourceChanged; }
public ClrMappedDSP(IDoCrudWithMapping <T> dataAccessLayer, BetterLCVCreatorDelegate <T> betterLCVCreatorDelegate /*, bool isAsynchronous*/) { _dataAccessLayerWithMapping = dataAccessLayer; _betterLCVCreatorDelegate = betterLCVCreatorDelegate; //IsAsynchronous = isAsynchronous; _dataAccessLayerSimple = dataAccessLayer as IDoCRUD <T>; if (_dataAccessLayerSimple == null) { throw new InvalidOperationException($"The dataAccessLayer ({nameof(IDoCrudWithMapping<T>)}) does not implement {nameof(IDoCRUD<T>)}."); } // TODO: Consider adding a DataSourceChanged event declaration on the IDoCrudWithMapping<T> interface. _dataAccessLayerSimple.DataSourceChanged += _dataAccessLayer_DataSourceChanged; }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // Dispose managed state (managed objects). DisposeOldData(this.Data); _dataAccessLayerSimple.Dispose(); } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // Set large fields to null. _dataAccessLayerWithMapping = null; disposedValue = true; } }