Exemplo 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;
        }
Exemplo n.º 2
0
        private MasterEntities CreateContext()
        {
            var context = new MasterEntities();

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