Type Restriction
<p>Can we restrict Type property of a class to be a specific type?</p>

<p>Eg:</p>

<pre><code>public interface IEntity { }

public class Entity : IEntity {}

public class NonEntity{}

class SampleControl {
    public Type EntityType{get;set;}
}
</code></pre>

<p>assume that sampleControl is UI class (may be Control,Form,..) its Value of EntityType Property should only accept the value of typeof(Entity), but not the the typeof(NonEntity) how can we restrict the user to give the specific type at Deign time(bcause - Sample is a control or form we can set its property at design time) , is this posible in C# .net</p>

<p>How can we achive this using C# 3.0?</p>

<p>In my above class I need the Type property that to this must be one of the IEntity.</p>
