.net - What is the difference between Tuple and keyvaluepair -
i not understanding difference between tuple , keyvaluepair. looking article http://www.dotnetperls.com/tuple-keyvaluepair. seems tuple improve keyvaluepair of developers saying strictly not utilize tuple wonder why?
i think programmers saying not utilize tuples because on public api, less effective.
lets have tuple
tuple<int,string,string,int> then how identify these values later or representing. think thats why programmers that. in case consumer has either guess or documentation know mean.
the msdn says:
a tuple info construction has specific number , sequence of elements.
tuples commonly used in 4 ways:
to represent single set of data. example, tuple can represent database record, , components can represent individual fields of record. to provide easy access to, , manipulation of, info set. to homecoming multiple values method without using out parameters (in c#) or byref parameters (in visual basic). to pass multiple values method through single parameter. example, thread.start(object) method has single parameter that lets supply 1 value method thread executes at startup time. if supply tuple object method argument, can supply thread’s startup routine 3 items of data. .net tuples keyvaluepair
No comments:
Post a Comment