Esempio n. 1
0
        private DataContextInternal(Type[] entityTypes, DbCompiledModel model)
            : base(DataContextInternalModelFactory.GetConnectionString(entityTypes), model)
        {
            _model = model;

            foreach (var type in entityTypes)
            {
                RecursivelyAddEntityTypes(type);
            }

            SetInitializer(this);
            Database.Log = Debug.SQLDebug;

            if (this.Database.Connection is SqlConnection)
            {
                var conn = this.Database.Connection as SqlConnection;
                conn.InfoMessage += Conn_InfoMessage;
            }

            IsReadonly = false;
        }
Esempio n. 2
0
 public DataContextInternal(params Type[] entityTypes) : this(entityTypes, DataContextInternalModelFactory.GetCompiledModel(entityTypes))
 {
 }