Example #1
0
        public JsonResult ImportTransactionData()
        {
            var transactionDataService = new TransactionDataService();
            var elapsedTime            = PerformanceTools.MeasureElapsedTime(() => transactionDataService.Import());

            return(Json(new BaseApiResponse {
                ElapsedTime = elapsedTime
            }));
        }
Example #2
0
        public JsonResult GenerateTransactionData(int batchCount, int rowsInFile)
        {
            var transactionDataService = new TransactionDataService();
            var elapsedTime            = PerformanceTools.MeasureElapsedTime(() => transactionDataService.Generate(batchCount, rowsInFile));

            return(Json(new BaseApiResponse {
                ElapsedTime = elapsedTime
            }));
        }
Example #3
0
        private static void FourthTask(int skip, int take)
        {
            var transactionDataService = new TransactionDataService();
            var transactionalDataItems = transactionDataService.FetchTransactionalData(skip, take);

            Console.WriteLine();
            Console.WriteLine("Fetched transactional data items:");
            foreach (var item in transactionalDataItems)
            {
                Console.WriteLine($"{item.Id}\t{item.ReferenceDataId}\t{item.DataValue}");
            }
            Console.WriteLine();
        }
Example #4
0
        public JsonResult GetTransactionData(int skip, int take)
        {
            var transactionDataService = new TransactionDataService();

            var transactionalDataItems = Enumerable.Empty <TransactionalData>();

            var elapsedTime = PerformanceTools.MeasureElapsedTime(() =>
            {
                transactionalDataItems = transactionDataService.FetchTransactionalData(skip, take);
            });

            return(Json(new TransactionDataApiResponse
            {
                ElapsedTime = elapsedTime,
                TransactionalDataItems = transactionalDataItems
            }));
        }
Example #5
0
        private static void ThirdTask()
        {
            var transactionDataService = new TransactionDataService();

            transactionDataService.Import();
        }
Example #6
0
        private static void SecondTask(int batchCount, int rowsInFile)
        {
            var transactionDataService = new TransactionDataService();

            transactionDataService.Generate(batchCount, rowsInFile);
        }