I have an interface IEntity
public interface IEntity{
bool Validate();
}
And I have a class Employee which implements this interface
public class Employee : IEntity{
public bool Validate(){ return true; }
}
Now if I have the following code
Employee emp1 = new Employee();
IEntity ent1 = (IEntity)emp1; // Is this a boxing conversion?
If it is not a boxing conversion then how does the cast work?
No, since
Employee
is a class, which is a reference type rather than a value type.From MSDN:
The aforementioned MSDN link has further examples that should help clarify the topic.