You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/04/08 18:30:37 UTC
[GitHub] [ignite] gurustron commented on a change in pull request #7628:
IGNITE-7609 .NET: FieldsQueryCursor should expose data types too
gurustron commented on a change in pull request #7628: IGNITE-7609 .NET: FieldsQueryCursor should expose data types too
URL: https://github.com/apache/ignite/pull/7628#discussion_r405729244
##########
File path: modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Query/FieldsQueryCursor.cs
##########
@@ -85,5 +92,26 @@ public IList<string> FieldNames
Target.OutStream(OpGetFieldNames, reader => reader.ReadStringCollection())));
}
}
+
+ /** <inheritdoc /> */
+ public IList<IQueryCursorField> Fields
+ {
+ get
+ {
+ if (_fieldsMeta == null)
+ {
+ var metadata = Target.OutStream(
+ OpGetFieldsMeta,
+ reader => reader.ReadCollectionRaw(stream =>
+ new QueryCursorField(stream) as IQueryCursorField))
+ ?? new List<IQueryCursorField>();
+
+ _fieldsMeta = new ReadOnlyCollection<IQueryCursorField>(
+ metadata as List<IQueryCursorField> ?? metadata.ToList());
Review comment:
As far as i understand .AsReadOnly() is not an option here cause we have IList in contract and if the underlying collection is mutable it will allow mutations.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services