The C # version also does not compile for the same reason. It should be:
public static void AddObjects<T>(this ObjectSet<T> objectSet, IEnumerable<T> objects) where T : class
And the VB version:
<Extension> _ Public Sub AddObjects(Of T As Class)(ByVal objectSet As ObjectSet(Of T), _ ByVal objects As IEnumerable(Of T)) Dim local As T For Each local In objects objectSet.AddObject(local) Next End Sub
Note that in VB version, the restriction is part of the type parameter declaration. See MSDN for more information.
source share