<p>I want to make a generic class that accepts only serializable classes, can it be done with the where constraint?</p>

<p>The concept I'm looking for is this:</p>

<pre><code>public class MyClass&lt;T&gt; where T : //[is serializable/has the serializable attribute]
</code></pre>

Nope, I'm afraid not. The only things you can do with constraints are:
```
where T : class
```
- T must be a reference type
```
where T : struct
```
- T must be a non-nullable value type
```
where T : SomeClass
```
- T must be SomeClass or derive from it
```
where T : ISomeInterface
```
- T must be ISomeInterface or implement it
```
where T : new()
```
- T must have a public parameterless constructor
Various combinations are feasible, but not all. Nothing about attributes.