Exemplo n.º 1
0
        // 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;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
 private bool TryGetDataFromProp(IDoCRUD <T> dataAccessLayer, out IEnumerable <T> data)
 {
     data = dataAccessLayer.Get(200);
     return(true);
 }