示例#1
0
        //--------------------------------------------------------------------//

        public alfaDS()
        {
            if (alfaDS.m_ConnStr == null)
            {
                // Get Connection
                alfaDS.m_ConnStr = alfaEntity.ConnStr_DeCrypt();

                if (alfaDS.m_ConnStr == null)
                {
                    // Message
                    alfaMsg.Error("ERROR = ORACLE ConnectionString is Not Valid ...!");

                    // Close Application
                    System.Environment.Exit(1);
                }
            }

            // Create Entity Context
            this.Context = new Entities();

            // Disable LazyLoading
            this.Context.Configuration.LazyLoadingEnabled = false;

            // Create Connection
            alfaConStr p_Connection = new alfaConStr(alfaDS.m_ConnStr);

            // Set Connection String
            this.Context.Database.Connection.ConnectionString = p_Connection.sbDB.ConnectionString;
        }
示例#2
0
        //--------------------------------------------------------------------//

        public alfaDS(string p_ConnStr)
        {
            // Create Entity Context
            this.Context = new Entities();

            // Disable LazyLoading
            this.Context.Configuration.LazyLoadingEnabled = false;

            // Create Connection
            alfaConStr p_Connection = new alfaConStr(p_ConnStr);

            // Set Connection String
            this.Context.Database.Connection.ConnectionString = p_Connection.sbDB.ConnectionString;
        }