コード例 #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);
            }
        }
コード例 #2
0
 private static void SaveToDb(Stuent student)
 {
     throw new NotImplementedException();
 }