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; }
private MasterEntities CreateContext() { var context = new MasterEntities(); context.Configuration.AutoDetectChangesEnabled = false; context.Configuration.ValidateOnSaveEnabled = false; return context; }
private BaseAccessor() { _context = new MasterEntities(); }