Exemplo n.º 1
0
 private void CheckAssignSetupType(ConnectionSetupType type)
 {
     if (SetupType != ConnectionSetupType.DefaultConfiguration)
     {
         throw new LinqToDBException(
                   $"LinqToDbConnectionOptionsBuilder already setup using {SetupType}, use Reset first to overwrite");
     }
     SetupType = type;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Reset the builder back to default configuration undoing all previous configured values
        /// </summary>
        /// <returns>The builder instance so calls can be chained.</returns>
        public LinqToDbConnectionOptionsBuilder Reset()
        {
            MappingSchema       = null;
            DataProvider        = null;
            ConfigurationString = null;
            ConnectionString    = null;
            DbConnection        = null;
            ProviderName        = null;
            DbTransaction       = null;
            ConnectionFactory   = null;
            TraceLevel          = null;
            OnTrace             = null;
            WriteTrace          = null;
            SetupType           = ConnectionSetupType.DefaultConfiguration;

            return(this);
        }