File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed
SmartSql.Test.Unit/DbSessions Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 22 <PropertyGroup >
33 <VersionMajor >4</VersionMajor >
44 <VersionMinor >0</VersionMinor >
5- <VersionPatch >8 </VersionPatch >
5+ <VersionPatch >10 </VersionPatch >
66 <VersionPrefix >$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix >
77 </PropertyGroup >
88</Project >
Original file line number Diff line number Diff line change @@ -235,8 +235,9 @@ public void DeleteCheckIsNotEmptyRequired()
235235 public void SP ( )
236236 {
237237 SqlParameterCollection dbParameterCollection = new SqlParameterCollection ( ) ;
238- dbParameterCollection . Add ( new SqlParameter ( "Total" , null , typeof ( int ) )
238+ dbParameterCollection . Add ( new SqlParameter
239239 {
240+ Name = "Total" ,
240241 DbType = System . Data . DbType . Int32 ,
241242 Direction = System . Data . ParameterDirection . Output
242243 } ) ;
Original file line number Diff line number Diff line change @@ -10,14 +10,38 @@ namespace SmartSql.Data
1010 public class SqlParameter
1111 {
1212 private DbParameter _sourceParameter ;
13+ private object _value ;
14+ public SqlParameter ( )
15+ {
16+ }
17+ public SqlParameter ( string name , object val )
18+ {
19+ Name = name ;
20+ Value = val ;
21+ if ( val != null )
22+ {
23+ ParameterType = val . GetType ( ) ;
24+ }
25+ }
1326 public SqlParameter ( string name , object val , Type parameterType )
1427 {
1528 Name = name ;
1629 Value = val ;
1730 ParameterType = parameterType ;
1831 }
1932 public string Name { get ; set ; }
20- public object Value { get ; set ; }
33+ public object Value
34+ {
35+ get => _value ;
36+ set
37+ {
38+ _value = value ;
39+ if ( value != null )
40+ {
41+ ParameterType = value . GetType ( ) ;
42+ }
43+ }
44+ }
2145 public Type ParameterType { get ; set ; }
2246 public Action < SqlParameter > OnSetSourceParameter { get ; set ; }
2347
You can’t perform that action at this time.
0 commit comments