Commit d9ef0084 authored by mgravell's avatar mgravell

binary as a naked type

parent 06abcbdf
...@@ -632,15 +632,17 @@ private static CacheInfo GetCacheInfo(Identity identity) ...@@ -632,15 +632,17 @@ private static CacheInfo GetCacheInfo(Identity identity)
private static Func<IDataReader, T> GetDeserializer<T>(IDataReader reader, int startBound, int length, bool returnNullIfFirstMissing) private static Func<IDataReader, T> GetDeserializer<T>(IDataReader reader, int startBound, int length, bool returnNullIfFirstMissing)
{ {
Type type = typeof(T);
#if !CSHARP30 #if !CSHARP30
// dynamic is passed in as Object ... by c# design // dynamic is passed in as Object ... by c# design
if (typeof(T) == typeof(object) if (type == typeof(object)
|| typeof(T) == typeof(FastExpando)) || type == typeof(FastExpando))
{ {
return GetDynamicDeserializer<T>(reader, startBound, length, returnNullIfFirstMissing); return GetDynamicDeserializer<T>(reader, startBound, length, returnNullIfFirstMissing);
} }
#endif #endif
if (typeof(T).IsClass && typeof(T) != typeof(string))
if (type.IsClass && type != typeof(string) && type != typeof(byte[]))
{ {
return GetClassDeserializer<T>(reader, startBound, length, returnNullIfFirstMissing); return GetClassDeserializer<T>(reader, startBound, length, returnNullIfFirstMissing);
} }
......
...@@ -65,7 +65,10 @@ public void SelectListInt() ...@@ -65,7 +65,10 @@ public void SelectListInt()
connection.Query<int>("select 1 union all select 2 union all select 3") connection.Query<int>("select 1 union all select 2 union all select 3")
.IsSequenceEqualTo(new[] { 1, 2, 3 }); .IsSequenceEqualTo(new[] { 1, 2, 3 });
} }
public void SelectBinary()
{
connection.Query<byte[]>("select cast(1 as varbinary(4))").First().SequenceEqual(new byte[] {1});
}
public void PassInIntArray() public void PassInIntArray()
{ {
connection.Query<int>("select * from (select 1 as Id union all select 2 union all select 3) as X where Id in @Ids", new { Ids = new int[] { 1, 2, 3 }.AsEnumerable() }) connection.Query<int>("select * from (select 1 as Id union all select 2 union all select 3) as X where Id in @Ids", new { Ids = new int[] { 1, 2, 3 }.AsEnumerable() })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment