Догађаји
Изградите интелигентне апликације
17. мар 23 - 21. мар 23
Придружите се серији састанака како бисте изградили скалабилна АИ решења заснована на стварним случајевима коришћења са колегама програмерима и стручњацима.
Региструјте се одмахОвај прегледач више није подржан.
Надоградите на Microsoft Edge бисте искористили најновије функције, безбедносне исправке и техничку подршку.
Property | Value |
---|---|
Rule ID | IDE0033 |
Title | Use explicitly provided tuple name |
Category | Style |
Subcategory | Language rules (expression-level preferences) |
Applicable languages | C# and Visual Basic |
Options | dotnet_style_explicit_tuple_names |
This style rule concerns the use of explicit tuple names versus implicit 'ItemX' properties when accessing tuple fields.
Options specify the behavior that you want the rule to enforce. For information about configuring options, see Option format.
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 |
// 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
If you want to suppress only a single violation, add preprocessor directives to your source file to disable and then re-enable the rule.
#pragma warning disable IDE0033
// The code that's violating the rule is on this line.
#pragma warning restore IDE0033
To disable the rule for a file, folder, or project, set its severity to none
in the configuration file.
[*.{cs,vb}]
dotnet_diagnostic.IDE0033.severity = none
To disable all of the code-style rules, set the severity for the category Style
to none
in the configuration file.
[*.{cs,vb}]
dotnet_analyzer_diagnostic.category-Style.severity = none
For more information, see How to suppress code analysis warnings.
.NET повратне информације
.NET је пројекат отвореног кода. Изаберите везу да бисте обезбедили повратне информације:
Догађаји
Изградите интелигентне апликације
17. мар 23 - 21. мар 23
Придружите се серији састанака како бисте изградили скалабилна АИ решења заснована на стварним случајевима коришћења са колегама програмерима и стручњацима.
Региструјте се одмах