This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +45
-1
lines changed
tests/ServiceStack.OrmLite.Tests/Issues Expand file tree Collapse file tree 2 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ private static IEnumerable GetMultiValues(object value)
96
96
97
97
return ( value is IEnumerable enumerable &&
98
98
! ( enumerable is string ||
99
- enumerable is IEnumerable < KeyValuePair < string , object > > )
99
+ enumerable is IEnumerable < KeyValuePair < string , object > > ||
100
+ enumerable is byte [ ] )
100
101
) ? enumerable : null ;
101
102
}
102
103
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+ using System . Text ;
5
+ using System . Threading . Tasks ;
6
+ using NUnit . Framework ;
7
+ using ServiceStack . Logging ;
8
+ using ServiceStack . Text ;
9
+
10
+ namespace ServiceStack . OrmLite . Tests . Issues
11
+ {
12
+ public class SelectWithBytesIssue : OrmLiteTestBase
13
+ {
14
+ public class ModelWithBytes
15
+ {
16
+ public int Id { get ; set ; }
17
+ public byte [ ] Bytes { get ; set ; }
18
+ }
19
+
20
+ [ Test ]
21
+ public void Can_select_ModelWithBytes_using_anon_type ( )
22
+ {
23
+ using ( var db = OpenDbConnection ( ) )
24
+ {
25
+ db . DropAndCreateTable < ModelWithBytes > ( ) ;
26
+
27
+ db . Insert ( new ModelWithBytes
28
+ {
29
+ Id = 1 ,
30
+ Bytes = 1 . ToUtf8Bytes ( )
31
+ } ) ;
32
+
33
+ var result = db . Single < ModelWithBytes > ( new
34
+ {
35
+ Bytes = 1 . ToUtf8Bytes ( )
36
+ } ) ;
37
+
38
+ Assert . That ( result , Is . Not . Null ) ;
39
+ }
40
+ }
41
+
42
+ }
43
+ }
You can’t perform that action at this time.
0 commit comments