gurustron commented on code in PR #1906:
URL: https://github.com/apache/ignite-3/pull/1906#discussion_r1160679211
##########
modules/platforms/dotnet/Apache.Ignite/Internal/Linq/ResultSelector.cs:
##########
@@ -195,6 +207,65 @@ private static RowReader<T>
EmitSingleColumnReader<T>(IColumnMetadata column, Re
return (RowReader<T>)method.CreateDelegate(typeof(RowReader<T>));
}
+ private static RowReader<T> EmitMemberInitReader<T>(
+ MemberInitCacheTarget target,
+ IReadOnlyList<IColumnMetadata> columns,
+ ResultSelectorOptions options)
+ {
+ var method = new DynamicMethod(
+ name:
$"MemberInitFromBinaryTupleReader_{typeof(T).FullName}_{GetNextId()}",
+ returnType: typeof(T),
+ parameterTypes: new[] { typeof(IReadOnlyList<IColumnMetadata>),
typeof(BinaryTupleReader).MakeByRefType() },
+ m: typeof(IIgnite).Module,
+ skipVisibility: true);
+
+ var il = method.GetILGenerator();
+ var ctorParams = target.CtorInfo.GetParameters();
+ var membersInitiated = target.PropertiesOrFields;
+
+ if (ctorParams.Length + membersInitiated.Count != columns.Count)
+ {
+ throw new InvalidOperationException("Constructor parameter count +
initialized members parameter count" +
Review Comment:
AFAIK no but I prefer to keep it as safeguard JIC.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]