# Generic Constraint

A where clause limiting which types may be used for a generic parameter.

## What is **Generic Constraint** in C#?

**Generic Constraint** — A where clause limiting which types may be used for a generic parameter.

```csharp
class Factory
{
    T Create<T>() where T : new()
    {
        return new T();
    }
}
```

Level: Freelancer · [More C# terms at this level](https://www.ask-codey.com/glossary/subjects/c-sharp/freelancer)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/generic-constraint
