Esempio n. 1
0
        private MasterEntities AddToContext(MasterEntities context, Tweet entity, int count,
                                                        int commitCount, bool recreateContext)
        {
            context.Tweets.Add(entity);

            if (count % commitCount == 0)
            {
                context.SaveChanges();
                if (recreateContext)
                {
                    context.Dispose();
                    context = CreateContext();
                }
            }

            return context;
        }
Esempio n. 2
0
        private MasterEntities CreateContext()
        {
            var context = new MasterEntities();

            context.Configuration.AutoDetectChangesEnabled = false;
            context.Configuration.ValidateOnSaveEnabled = false;
            return context;
        }
Esempio n. 3
0
 private BaseAccessor()
 {
     _context = new MasterEntities();
 }