@@ -42,28 +42,48 @@ IF v_integer_values[3] <> 3 THEN
42
42
private const string Drop = "DROP FUNCTION f_service_stack(text[], integer[]);" ;
43
43
44
44
[ Alias ( "f_service_stack" ) ]
45
- public class ServiceStackFunction
45
+ public class ServiceStackFunctionWithAlias
46
46
{
47
47
[ CustomField ( "text[]" ) ]
48
+ [ Alias ( "v_string_values" ) ]
48
49
public string [ ] StringValues { get ; set ; }
49
50
[ CustomField ( "integer[]" ) ]
51
+ [ Alias ( "v_integer_values" ) ]
50
52
public int [ ] IntegerValues { get ; set ; }
51
53
}
52
54
55
+ [ Alias ( "f_service_stack" ) ]
56
+ public class ServiceStackFunctionNoAlias
57
+ {
58
+ [ CustomField ( "text[]" ) ]
59
+ public string [ ] v_string_values { get ; set ; }
60
+ [ CustomField ( "int[]" ) ]
61
+ public int [ ] v_integer_values { get ; set ; }
62
+ }
63
+
53
64
[ Test ]
54
- [ Ignore ( "This test fails both on .NET and .NET Core" ) ]
55
65
public void Can_execute_stored_procedure_with_array_arguments ( )
56
66
{
57
67
using ( var db = OpenDbConnection ( ) )
58
68
{
59
69
db . ExecuteSql ( Create ) ;
60
70
db . GetLastSql ( ) . Print ( ) ;
61
71
62
- db . ExecuteProcedure ( new ServiceStackFunction
72
+ // Execute using [Alias()] attribute
73
+ db . ExecuteProcedure ( new ServiceStackFunctionWithAlias
63
74
{
64
75
StringValues = new [ ] { "ServiceStack" , "Thoughtfully Architected" } ,
65
76
IntegerValues = new [ ] { 1 , 2 , 3 }
66
77
} ) ;
78
+ db . GetLastSql ( ) . Print ( ) ;
79
+
80
+ // Execute without using [Alias()] attribute
81
+ db . ExecuteProcedure ( new ServiceStackFunctionNoAlias
82
+ {
83
+ v_string_values = new [ ] { "ServiceStack" , "Thoughtfully Architected" } ,
84
+ v_integer_values = new [ ] { 1 , 2 , 3 }
85
+ } ) ;
86
+ db . GetLastSql ( ) . Print ( ) ;
67
87
68
88
db . ExecuteSql ( Drop ) ;
69
89
}
0 commit comments