예제 #1
0
        protected void CreateDbContext()
        {
            DbContext = new ProPaymentSummaryEntities();
            DbContext.Configuration.ProxyCreationEnabled  = false;
            DbContext.Configuration.LazyLoadingEnabled    = false;
            DbContext.Configuration.ValidateOnSaveEnabled = false;

            ProPaymentSummaryEntities = DbContext as ProPaymentSummaryEntities;
            if (ProPaymentSummaryEntities != null)
            {
                ProPaymentSummaryEntities.Database.CommandTimeout = 1000;
            }
        }
예제 #2
0
        protected void CreateDbContext()
        {
            DbContext = new ProPaymentSummaryEntities();

            // Do NOT enable proxied entities, else serialization fails
            DbContext.Configuration.ProxyCreationEnabled = false;

            // Load navigation properties explicitly (avoid serialization trouble)
            DbContext.Configuration.LazyLoadingEnabled = false;

            // Because Web API will perform validation, we don't need/want EF to do so
            DbContext.Configuration.ValidateOnSaveEnabled = false;

            //DbContext.Configuration.AutoDetectChangesEnabled = false;
            // We won't use this performance tweak because we don't need
            // the extra performance and, when autodetect is false,
            // we'd have to be careful. We're not being that careful.
        }