Exemple #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;
        }
Exemple #2
0
        private MasterEntities CreateContext()
        {
            var context = new MasterEntities();

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