在C# 4.0中可以通過委託某個成員的實現來實現一個介面,例如下面的程式碼:
public class Foo : IList
{
private List _Collection implements IList;
public Foo()
{
_Collection = new List();
}
}
元組:
var list = new List<Tuple<int, string, object>>()
{
Tuple.Create(1, "a", new object()),
Tuple.Create(2, "b", new object()),
};