Reputation: 9
there are interface a, b, c;
// defined. interface d : b, c;
class C1 : a, b, c;
// I want to cast to interface d;
var t = c1 as d;
// t is null.
Upvotes: 1
Views: 48
Reputation: 136
d t = c1;
would do the trick.
For example in
IEnumerable<int> iList = new List<int>();
iList would not have List specific methods such as Add
Upvotes: 1