> ## Documentation Index
> Fetch the complete documentation index at: https://adro.codes/llms.txt
> Use this file to discover all available pages before exploring further.

# C# - Class Extension

> Use class extensions to add additional logic to a class without modifying the class itself.

```csharp theme={null}
class User {
	public string Firstname;
	public string Lastname;
}

class Extensions {
	public string Fullname(this User user) {
		return $"{user.Firstname} {user.Lastname}";
	}
}

User user;
string name = user.Fullname();
```

Adds the method `Fullname` to a instance of `User` without needing to add the method to the `User` method.
