@@ -57,6 +57,7 @@ internal sealed class ConnectionString
5757 internal const FbWireCrypt DefaultValueWireCrypt = FbWireCrypt . Enabled ;
5858 internal const string DefaultValueApplicationName = "" ;
5959 internal const int DefaultValueCommandTimeout = 0 ;
60+ internal const int DefaultValueParallelWorkers = 0 ;
6061
6162 internal const string DefaultKeyUserId = "user id" ;
6263 internal const string DefaultKeyPortNumber = "port number" ;
@@ -86,6 +87,7 @@ internal sealed class ConnectionString
8687 internal const string DefaultKeyWireCrypt = "wire crypt" ;
8788 internal const string DefaultKeyApplicationName = "application name" ;
8889 internal const string DefaultKeyCommandTimeout = "command timeout" ;
90+ internal const string DefaultKeyParallelWorkers = "parallel workers" ;
8991 #endregion
9092
9193 #region Static Fields
@@ -158,6 +160,9 @@ internal sealed class ConnectionString
158160 { "app" , DefaultKeyApplicationName } ,
159161 { DefaultKeyCommandTimeout , DefaultKeyCommandTimeout } ,
160162 { "commandtimeout" , DefaultKeyCommandTimeout } ,
163+ { DefaultKeyParallelWorkers , DefaultKeyParallelWorkers } ,
164+ { "parallelworkers" , DefaultKeyParallelWorkers } ,
165+ { "parallel" , DefaultKeyParallelWorkers } ,
161166 } ;
162167
163168 internal static readonly IDictionary < string , object > DefaultValues = new Dictionary < string , object > ( StringComparer . Ordinal )
@@ -190,6 +195,7 @@ internal sealed class ConnectionString
190195 { DefaultKeyWireCrypt , DefaultValueWireCrypt } ,
191196 { DefaultKeyApplicationName , DefaultValueApplicationName } ,
192197 { DefaultKeyCommandTimeout , DefaultValueCommandTimeout } ,
198+ { DefaultKeyParallelWorkers , DefaultValueParallelWorkers } ,
193199 } ;
194200
195201 #endregion
@@ -230,6 +236,7 @@ internal sealed class ConnectionString
230236 public FbWireCrypt WireCrypt => GetWireCrypt ( DefaultKeyWireCrypt , _options . TryGetValue ) ;
231237 public string ApplicationName => GetString ( DefaultKeyApplicationName , _options . TryGetValue ) ;
232238 public int CommandTimeout => GetInt32 ( DefaultKeyCommandTimeout , _options . TryGetValue ) ;
239+ public int ParallelWorkers => GetInt32 ( DefaultKeyParallelWorkers , _options . TryGetValue ) ;
233240
234241 #endregion
235242
@@ -291,6 +298,10 @@ public void Validate()
291298 {
292299 throw new ArgumentException ( "Cannot use Pooling and NoDatabaseTriggers together." ) ;
293300 }
301+ if ( ParallelWorkers < 0 )
302+ {
303+ throw new ArgumentException ( string . Format ( CultureInfo . CurrentCulture , "'Parallel Workers' value of {0} is not valid.{1}The value should be an integer >= 0." , ParallelWorkers , Environment . NewLine ) ) ;
304+ }
294305 }
295306
296307 #endregion
0 commit comments