@@ -15,21 +15,14 @@ public static class SQLiteParameterExtensions
1515 public static SQLiteParameter CreateInputParam ( this DbType dbType , string parameterName , object ? objValue = null )
1616 {
1717 Debug . Assert ( ! string . IsNullOrEmpty ( parameterName ) , $ "{ nameof ( parameterName ) } is null or empty") ;
18- #if NET_OLD
19- Debug . Assert ( parameterName ? . StartsWith ( "@" ) == true , $ "Parameter name '{ parameterName } ' should starts with '@'") ;
20- #else
2118 Debug . Assert ( parameterName ? . StartsWith ( '@' ) == true , $ "Parameter name '{ parameterName } ' should starts with '@'") ;
22- #endif
2319#if NET8_0_OR_GREATER
2420 ArgumentException . ThrowIfNullOrEmpty ( parameterName ) ;
2521#else
2622 Throw . IfNullOrEmpty ( parameterName ) ;
2723#endif
28- #if NET_OLD
29- Throw . ArgumentExceptionIf ( parameterName . StartsWith ( "@" ) != true , $ "Parameter '{ parameterName } ' should starts with '@'") ;
30- #else
3124 Throw . ArgumentExceptionIf ( parameterName . StartsWith ( '@' ) != true , $ "Parameter '{ parameterName } ' should starts with '@'") ;
32- #endif
25+
3326 var param = new SQLiteParameter ( parameterName , dbType ) ;
3427 if ( objValue is null )
3528 {
@@ -54,23 +47,16 @@ public static SQLiteParameter CreateInputParam(this DbType dbType, string parame
5447 public static SQLiteParameter CreateSourceParam ( this DbType dbType , string parameterName , string sourceColumn )
5548 {
5649 Debug . Assert ( ! string . IsNullOrEmpty ( parameterName ) , $ "{ nameof ( parameterName ) } is null or empty") ;
57- #if NET_OLD
58- Debug . Assert ( parameterName ? . StartsWith ( "@" ) == true , $ "Parameter name '{ parameterName } ' should starts with '@'") ;
59- #else
6050 Debug . Assert ( parameterName ? . StartsWith ( '@' ) == true , $ "Parameter name '{ parameterName } ' should starts with '@'") ;
61- #endif
6251#if NET8_0_OR_GREATER
6352 ArgumentException . ThrowIfNullOrEmpty ( parameterName ) ;
6453 ArgumentException . ThrowIfNullOrEmpty ( sourceColumn ) ;
6554#else
6655 Throw . IfNullOrEmpty ( parameterName ) ;
6756 Throw . IfNullOrEmpty ( sourceColumn ) ;
6857#endif
69- #if NET_OLD
70- Throw . ArgumentExceptionIf ( parameterName . StartsWith ( "@" ) != true , $ "Parameter '{ parameterName } ' should starts with '@'") ;
71- #else
7258 Throw . ArgumentExceptionIf ( parameterName . StartsWith ( '@' ) != true , $ "Parameter '{ parameterName } ' should starts with '@'") ;
73- #endif
59+
7460 return new SQLiteParameter ( parameterName , dbType , sourceColumn ) ;
7561 }
7662
@@ -86,23 +72,16 @@ public static SQLiteParameter CreateSourceParam(this DbType dbType, string param
8672 public static SQLiteParameter CreateSourceParam ( this DbType dbType , string parameterName , string sourceColumn , DataRowVersion rowVersion )
8773 {
8874 Debug . Assert ( ! string . IsNullOrEmpty ( parameterName ) , $ "{ nameof ( parameterName ) } is null or empty") ;
89- #if NET_OLD
90- Debug . Assert ( parameterName ? . StartsWith ( "@" ) == true , $ "Parameter name '{ parameterName } ' should starts with '@'") ;
91- #else
9275 Debug . Assert ( parameterName ? . StartsWith ( '@' ) == true , $ "Parameter name '{ parameterName } ' should starts with '@'") ;
93- #endif
9476#if NET8_0_OR_GREATER
9577 ArgumentException . ThrowIfNullOrEmpty ( parameterName ) ;
9678 ArgumentException . ThrowIfNullOrEmpty ( sourceColumn ) ;
9779#else
9880 Throw . IfNullOrEmpty ( parameterName ) ;
9981 Throw . IfNullOrEmpty ( sourceColumn ) ;
10082#endif
101- #if NET_OLD
102- Throw . ArgumentExceptionIf ( parameterName . StartsWith ( "@" ) != true , $ "Parameter '{ parameterName } ' should starts with '@'") ;
103- #else
10483 Throw . ArgumentExceptionIf ( parameterName . StartsWith ( '@' ) != true , $ "Parameter '{ parameterName } ' should starts with '@'") ;
105- #endif
84+
10685 return new SQLiteParameter ( parameterName , dbType , sourceColumn , rowVersion ) ;
10786 }
10887 }
0 commit comments