Most Useful Attributes

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Most Useful Attributes

Message par ForumBot »

Most Useful Attributes
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Most Useful Attributes

Message par ForumBot »

`[DebuggerDisplay]` can be really helpful to quickly see customized output of a Type when you mouse over the instance of the Type during debugging. example:

```
[DebuggerDisplay("FirstName={FirstName}, LastName={LastName}")]
class Customer
{
public string FirstName;
public string LastName;
}

```

This is how it should look in the debugger:

Also, it is worth mentioning that `[WebMethod]` attribute with `CacheDuration` property set can avoid unnecessary execution of the web service method.
Répondre

Revenir à « .NET & C# »