# Attribute

*noun*

say it: **“AT-rih-byoot”** **/ˈætrɪbjuːt/**

A label in square brackets on a C# class, method or property, such as \[TestMethod\], that tools and frameworks read.

## What is **Attribute** in C#?

**Attribute** — Metadata attached to C# declarations for compilers, tools, or runtime code.

```csharp
class Checkout
{
    [Obsolete]
    void OldCheckout()
    {
    }
}
```

## In a sentence

- “The **attribute** \[Required\] tells ASP.NET Core the Name property must have a value.”

Level: Master · [More C# terms at this level](https://www.ask-codey.com/glossary?category=c-sharp&level=5)

Updated: November 9, 2026

## In other subjects

- [Attribute in Database](https://www.ask-codey.com/glossary/attribute-database)
- [Attribute in HTML](https://www.ask-codey.com/glossary/attribute-html)
- [Attribute in Python](https://www.ask-codey.com/glossary/attribute)

Source: https://www.ask-codey.com/glossary/attribute-c-sharp
