コード例 #1
0
        public void saveLacCellBvciETLDocumentSet(string sqlconn)
        {
            TcpDbContext context = null;
            try
            {
                context = new TcpDbContext(sqlconn);
                context.Configuration.AutoDetectChangesEnabled = false;

                int count = 0;
                LacCellBvciETL lcbs = new LacCellBvciETL();
                foreach (var cell in lcbs.mongo_LacCellBvciETL.QueryMongo())
                {
                    ++count;
                    context = context.AddToContext(context, cell, count, bulksize, true, sqlconn);
                }

                context.SaveChanges();
            }
            finally
            {
                if (context != null)
                    context.Dispose();
            }
            Console.WriteLine("LacCellBvciETLDocument->TcpDbContext->ok");
        }
コード例 #2
0
 public TcpDbContext AddToContextCon(TcpDbContext context, int count, int commitCount, bool recreateContext, string sqlconn)
 {
     if (count % commitCount == 0)
     {
         Console.WriteLine(count);
         context.SaveChanges();
         if (recreateContext)
         {
             context.Dispose();
             context = new TcpDbContext(sqlconn);
             context.Configuration.AutoDetectChangesEnabled = false;
         }
     }
     return context;
 }
コード例 #3
0
        public void saveLlcTlliSessionDocumentSet(string sqlconn)
        {
            TcpDbContext context = null;
            try
            {
                context = new TcpDbContext(sqlconn);
                context.Configuration.AutoDetectChangesEnabled = false;

                int count = 0;
                LlcTlliSessionStaging tls = new LlcTlliSessionStaging();
                foreach (var llc in tls.mongo_LlcTlliSessionStaging.QueryMongo())
                {
                    ++count;
                    context = context.AddToContext(context, llc, count, bulksize, true, sqlconn);
                }

                context.SaveChanges();
            }
            finally
            {
                if (context != null)
                    context.Dispose();
            }
            Console.WriteLine("LlcTlliSessionDocument->TcpDbContext->ok");
        }