Commit f6e29fec authored by maxim's avatar maxim

It does not look like we need above if since we are typecasting value to T at the end.

parent 5039ea1c
......@@ -42,6 +42,7 @@
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper NET40\Properties\AssemblyInfo.cs">
......
......@@ -42,6 +42,7 @@
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="SqlMapper.cs" />
......
......@@ -1297,10 +1297,7 @@ private static IEnumerable<T> QueryImpl<T>(this IDbConnection cnn, CommandDefini
while (reader.Read())
{
object val = func(reader);
if (effectiveType == typeof(object))
{
yield return (T)(object)val;
} else if (val == null || val is T) {
if (val == null || val is T) {
yield return (T)val;
} else {
yield return (T)Convert.ChangeType(val, effectiveType);
......
......@@ -40,6 +40,7 @@
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper NET40\Properties\AssemblyInfo.cs">
......
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