提交 d9ef0084 编写于 作者: M mgravell

binary as a naked type

上级 06abcbdf
......@@ -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)
{
Type type = typeof(T);
#if !CSHARP30
// dynamic is passed in as Object ... by c# design
if (typeof(T) == typeof(object)
|| typeof(T) == typeof(FastExpando))
if (type == typeof(object)
|| type == typeof(FastExpando))
{
return GetDynamicDeserializer<T>(reader, startBound, length, returnNullIfFirstMissing);
}
#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);
}
......
......@@ -65,7 +65,10 @@ public void SelectListInt()
connection.Query<int>("select 1 union all select 2 union all select 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()
{
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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册