Esempio n. 1
0
        static void Main(string[] args)
        {
            Stuent stuent = new Stuent();

            IDumpContext dumpFileContext = new DumpContext();

            dumpFileContext.Load();
            for (IDumpFileQueue <DumpFile> fileQueue = dumpFileContext.FileQueue(); fileQueue.HasFile;)
            {
                DumpFile dumpFile = fileQueue.Dequeue();
                dumpFile.Load();
                IList <string> dumpFileValidationErrors;
                if (!dumpFile.Validate(out dumpFileValidationErrors))
                {
                    dumpFileContext.LogFileErrors(dumpFileValidationErrors);
                    dumpFileContext.Draft(dumpFile);
                }

                uint batchSize = 100;
                for (IDumpRowBatchIterator rowBatchIterator = dumpFile.BatchIterator(batchSize); rowBatchIterator.HasNextBatch;)
                {
                    IDumpRowBatch rowBatch = rowBatchIterator.Next();
                    for (DumRowQueue <Stuent> rowQueue = rowBatch.RowQueue(); rowQueue.HasRow;)
                    {
                        DumpRow <Stuent> row    = rowQueue.Dequeue();
                        Stuent           entity = row.Entity();

                        try
                        {
                            SaveToDb(entity);
                        }
                        catch (Exception ex)
                        {
                            dumpFileContext.Draft(dumpFile, row.(line));
                        }
                    }
                }

                dumpFileContext.Archive(dumpFile);
            }
        }
Esempio n. 2
0
 public void Draft(DumpFile dumpFile)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 3
0
 public void Archive(DumpFile dumpFile)
 {
     throw new System.NotImplementedException();
 }