Esempio n. 1
0
        /// <summary>
        /// Process single ETL operation
        /// </summary>
        /// <returns>Information regarding ETC process</returns>
        public OperationResult Process()
        {
            var extracted   = _extractor.Extract();
            var cleansed    = _cleanser.Cleanse(extracted);
            var transformed = _transformer.Transform(cleansed);

            return(_loader.Load(transformed));
        }
        public void Receive(byte[] content)
        {
            Stream input = new MemoryStream(content);
            NetworkBinaryReader reader = new NetworkBinaryReader(input);

            string dataString = reader.ReadUTF();

            R data = decoder.Transform(dataString);

            messageQueue.Post(() => listener(data));
        }
Esempio n. 3
0
        private async Task SetUpData(string filePath)
        {
            string[] file = await _fileLoader.ReadFile(filePath);

            _userInterface.ShowLoadingFileMessage(filePath);

            _userInterface.ShowTransformingDataMessage();
            PrecipitationResults result = _dataTransformer.Transform(file);

            await _precipitationRepository.Add(result.GridReferences);

            _userInterface.ShowCreatingDatabaseMessage();
        }
        public void WriteToServer(IEnumerable <TData> records, string tableName)
        {
            Check.NotNullOrEmpty(records, nameof(records));
            Check.NotNullOrWhiteSpace(tableName, nameof(tableName));

            // Transform records
            TBulkData bulkData = _dataTransformer.Transform(records);

            // Insert Data
            _bulkInsert.Write(
                records: bulkData,
                tableName: tableName
                );

            // Dipose bulkData if needed
            (bulkData as IDisposable)?.Dispose();
        }
Esempio n. 5
0
 protected override string Transform(string sourceData)
 {
     return(_transformer.Transform(sourceData));
 }
Esempio n. 6
0
        private IList <ClosedOperation <Trade> > GetClosedTrades(ReportOptions reportOptions, IList <Trade> trades)
        {
            var closedTrades = tradeTransformer.Transform(trades);

            return(closedTrades.Where(x => x.CloseTrade.DateTime.Year == reportOptions.Year).ToList());
        }