// 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 TryGetDataFromProp(IDoCRUD <T> dataAccessLayer, out IEnumerable <T> data) { data = dataAccessLayer.Get(200); return(true); }