With ValueTuple
in C# 7, it is now possible to write methods and properties that return or consume composite objects without explicitly declaring a type. These named tuples can however be potentially confusing when no documentation is provided.
As the primary and probably most convenient way of documenting libraries is by using XML documentation, is there any way using XML documentation to provide a description of the variables in a named tuple?
I know the obvious solution is to declare a type and document it accordingly. However, granted that due to some 'reasons' that cannot be done, is it possible to XML document the data members in a ValueTuple
?
NB: A similar question was asked before the advent of the ValueTuple
.
TryCast()
,Dictionary.TryGetValue()
). My question is about how to document tuples in those cases where using tuples is more expedient than predefined or one's own types. – TelloList<int>
vs aList<string>
. It's not even possible in C# to specify a type alias for a tuple, hence there's no construct to which one can apply that documentation. – Cachepot