varresult=connection.Query<Foo1,Bar1,Tuple<Foo1,Bar1>>("select 1 as Id, 2 as BarId, 3 as BarId, 'a' as Name",(f,b)=>Tuple.Create(f,b),splitOn:"BarId").First();
result.Item1.Id.IsEqualTo(1);
result.Item1.BarId.IsEqualTo(2);
result.Item2.BarId.IsEqualTo(3);
result.Item2.Name.IsEqualTo("a");
}
publicvoidTestLinqBinaryToClass()
{
byte[]orig=newbyte[20];
newRandom(123456).NextBytes(orig);
varinput=newSystem.Data.Linq.Binary(orig);
varoutput=connection.Query<WithBinary>("select @input as [Value]",new{input}).First().Value;
...
...
@@ -1045,7 +1066,10 @@ public void TestDynamicParamNullSupport()
output.ToArray().IsSequenceEqualTo(orig);
}
publicvoidTestLinqBinaryRaw()
{
byte[]orig=newbyte[20];
newRandom(123456).NextBytes(orig);
varinput=newSystem.Data.Linq.Binary(orig);
varoutput=connection.Query<System.Data.Linq.Binary>("select @input as [Value]",new{input}).First();
...
...
@@ -1053,15 +1077,9 @@ public void TestDynamicParamNullSupport()
output.ToArray().IsSequenceEqualTo(orig);
}
classWithBinary
{
publicSystem.Data.Linq.BinaryValue{get;set;}
varresult=connection.Query<Foo1,Bar1,Tuple<Foo1,Bar1>>("select 1 as Id, 2 as BarId, 3 as BarId, 'a' as Name",(f,b)=>Tuple.Create(f,b),splitOn:"BarId").First();