Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support F# anonymous types #1233

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
refactor convert ternary conditional to ifs
  • Loading branch information
enricosada authored and Enrico Sada committed Jan 8, 2020
commit c8b5ce7b9443e3f85fb7cc398620b1e82469698d
12 changes: 9 additions & 3 deletions Dapper/SqlMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3258,9 +3258,15 @@ private static void GenerateDeserializerFromMap(Type type, IDataReader reader, i
il.Emit(OpCodes.Ldloc, returnValueLocal); // [target]
}

var members = (specializedConstructor != null
? names.Select(n => typeMap.GetConstructorParameter(specializedConstructor, n))
: names.Select(n => typeMap.GetMember(n))).ToList();
List<IMemberMap> members;
if (specializedConstructor != null)
{
members = names.Select(n => typeMap.GetConstructorParameter(specializedConstructor, n)).ToList();
}
else
{
members = names.Select(n => typeMap.GetMember(n)).ToList();
}

// stack is now [target]
bool first = true;
Expand Down