What are the new collection interfaces available in C# 3.0 ?
In C# 2.0
ICo开发者_Go百科mparer
IEqualityComparer
IEnumerator
IEnumerable
ICollection
IDictionary
IDictionaryEnumerator
IList.
.NET 3.5 (commonly confused with C# 3.0, although they are completely separate) introduced:
IGrouping<TKey,TValue>
ILookup<TKey,TValue>
IOrderedEnumerable<T>
IOrderedQueryable
IOrderedQueryable<T>
IQueryable
IQueryable<T>
IQueryProvider
and concrete types:
HashSet<T>
Lookup<TKey,TValue>
(and a load of private stuff, but those are the main public ones)
No new interfaces AFAIK, but in the .NET Framework 3.5 (C# 3) you get the new HashSet<T>
collection class which implements a set (in the System.Core assembly).
(Collection) interfaces are defined in the .Net class libraries, not in the C# language.
And in .Net 2.0 your list is missing all the generic interfaces. In .Net 3.0 there weren't any new.
You can compare collection interfaces available in C# 2.0 with collection interfaces available in C# 3.0
no new interface.
As far as I can tell, there's nothing new in 3.0 when it comes to collection interface.
.NET 3.0 (not just C#) have new Collection Initializers:
List<Class1> someClasses = new List<Class1>
{
new Class1
{
Prop1 = "abc",
Prop2 = 123
},
new Class1
{
Prop1 = "xyz",
Prop2 = 789
}
};
精彩评论