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

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