This style rule concerns the use of explicit tuple names versus implicit 'ItemX' properties when accessing tuple fields.
Options
Options specify the behavior that you want the rule to enforce. For information about configuring options, see Option format.
dotnet_style_explicit_tuple_names
Property
Value
Description
Option name
dotnet_style_explicit_tuple_names
Option values
true
Prefer tuple names to ItemX properties
false
Prefer ItemX properties to tuple names
Default option value
true
C#
// dotnet_style_explicit_tuple_names = true
(string name, int age) customer = GetCustomer();
var name = customer.name;
// dotnet_style_explicit_tuple_names = false
(string, int) customer = GetCustomer();
var name = customer.Item1;
' dotnet_style_explicit_tuple_names = true
Dim customer As (name As String, age As Integer) = GetCustomer()
Dim name = customer.name
' dotnet_style_explicit_tuple_names = false
Dim customer As (String, Integer) = GetCustomer()
Dim name = customer.Item1
Suppress a warning
If you want to suppress only a single violation, add preprocessor directives to your source file to disable and then re-enable the rule.
C#
#pragmawarning disable IDE0033// The code that's violating the rule is on this line.#pragmawarning restore IDE0033
To disable the rule for a file, folder, or project, set its severity to none in the configuration file.
ამ შიგთავსის წყაროს მოძიება GitHub-ზე არის შესაძლებელი, სადაც თქვენ ასევე შეგიძლიათ პრობლემების შექმნა და განხილვა და მოთხოვნების გადმოტანა. დამატებითი ინფორმაციისთვის იხილეთ ჩვენი დამხმარე სახელმძღვანელო.
.NET-(ი)ს უკუკავშირი
.NET არის ღია წყაროს პროექტი. აირჩიეთ ბმული უკუკავშირის გასაგზავნად:
შემოუერთდით Meetup სერიას, რათა შექმნათ მასშტაბური AI გადაწყვეტილებები რეალურ სამყაროში გამოყენების შემთხვევებზე დაყრდნობით თანამემამულე დეველოპერებთან და ექსპერტებთან.