19 lines
407 B
Plaintext
19 lines
407 B
Plaintext
While both ``++new++`` and ``++Create++`` will yield the same ``++Tuple++``, the ``++Create++`` method automatically infers the argument types, yielding sleeker, more readable code.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
[source,text]
|
|
----
|
|
var fastAnimal = new Tuple<string, int>("Cheetah", 93); // Noncompliant
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
[source,text]
|
|
----
|
|
var fastAnimal = Tuple.Create("Cheetah", 93);
|
|
----
|
|
|