Beispiel #1
0
        private static void SaveCurrentTurnArounds(ICollection <CurrentTurnaround> currentTurnarounds)
        {
            var now = DateTime.Now;

            using (var context = new CoreImporterDbContext())
            {
                Console.WriteLine($"Saving current turnarounds");
                // TODO merge
                currentTurnarounds.ToList().ForEach(e => e.LoadDate = now);
                context.CurrentTurnarounds.AddRange(currentTurnarounds);

                context.SaveChanges();
            }
        }
Beispiel #2
0
        private static void SaveLatestTurnaroundUpdates(ICollection <LatestTurnaroundUpdate> latestTurnaroundUpdates)
        {
            var now = DateTime.Now;

            using (var context = new CoreImporterDbContext())
            {
                Console.WriteLine($"Saving latest turnaround updates");
                // TODO merge
                latestTurnaroundUpdates.ToList().ForEach(e => e.LoadDate = now);
                context.LatestTurnaroundUpdates.AddRange(latestTurnaroundUpdates);

                context.SaveChanges();
            }
        }