Пример #1
0
 public DataTransferObjectsTask(ManualResetEvent doneEvent, DtoProjectionEngine projectionLayer, DataLayerGateway dataLayerGateway,
                                GraphMap graphMap, DataObject objectType, DataTransferObjects dataTransferObjects)
 {
     _doneEvent        = doneEvent;
     _dataLayerGateway = dataLayerGateway;
     _projectionLayer  = projectionLayer;
     _projectionLayer.dataLayerGateway = dataLayerGateway;
     _objectType          = objectType;
     _graphMap            = graphMap;
     _dataTransferObjects = dataTransferObjects;
 }
Пример #2
0
        public void ThreadPoolCallback(object threadContext)
        {
            int threadIndex = (int)threadContext;

            if (_identifiers != null && _identifiers.Count > 0)
            {
                List <IDataObject> dataObjects = _dataLayerGateway.Get(_dataObject, _identifiers);

                if (dataObjects != null)
                {
                    XDocument dtoDoc = _projectionLayer.ToXml(_graphMap.name, ref dataObjects);

                    if (dtoDoc != null && dtoDoc.Root != null)
                    {
                        _dataTransferObjects = SerializationExtensions.ToObject <DataTransferObjects>(dtoDoc.Root);
                    }
                }
            }

            _doneEvent.Set();
        }