예제 #1
0
        /// <summary>
        /// Creates a new instance of the DbQuery class using a settings object.
        /// </summary>
        /// <param name="settings"></param>
        public DbQuery(DataflipSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            Settings = settings;
        }
예제 #2
0
        /// <summary>
        /// Creates a new instance of the DbQuery object using a connection string,
        /// use the Settings properties to setup additional settings.
        /// </summary>
        /// <param name="connectionString">A valid connection string.</param>
        /// <param name="commandTimeout">The time in seconds for the query to the method to wait before it throws a timeout exception, we know what you're thinking, finally someone makes think about the timeout of a query before I even setup the connection string.</param>
        public DbQuery(string connectionString, int commandTimeout)
        {
            if (connectionString == null)
            {
                throw new ArgumentNullException("connectionString");
            }

            Settings = new DataflipSettings()
            {
                ConnectionString = connectionString,
                CommandTimeout   = commandTimeout
            };
        }
예제 #3
0
        private void InvokeOnConfigure(DataflipConfigurationEventArgs e)
        {
            if (e.Settings == null)
            {
                e.Settings = new DataflipSettings();
            }

            if (Configure != null)
            {
                Configure(e);
            }

            Settings = e.Settings;
        }
예제 #4
0
 public DataflipContext(DataflipSettings settings)
 {
     Settings = settings;
 }
예제 #5
0
 /// <summary>
 /// Creates a new SqlQuery using a DataSettings object. In case you feel like customizing things, DataSettings
 /// objects are actually cool, they allow you to dictate how a connection and command objects get created.
 /// </summary>
 /// <param name="settings">
 /// A DataSettings object containing configuration information that defined how the query is
 /// executed.
 /// </param>
 public SqlQuery(DataflipSettings settings)
     :
     base(settings)
 {
 }