I have the following extension method:
public static EntitySet<T> ToEntitySetFromInterface<T, U>(this IList<U> source) where T : class, U { var es = new EntitySet<T>(); IEnumerator<U> ie = source.GetEnumerator(); while (ie.MoveNext()) { es.Add((T)ie.Current); } return es; }
and Im trying to use it like this:
List<IItemMovement> p = new List<IItemMovement>(); EntitySet<ItemMovement> ims = p.ToEntitySetFromInterface<ItemMovement, IItemMovement>();
where ItemMovement implements IItemMovement. The compiler complains:
'System.Collections.Generic.List' does not contain the definition of 'ToEntitySetFromInterface' and the extension method 'ToEntitySetFromInterface' that takes the first argument of the type 'System.Collections.Generic.List' can be found (do you have a using directive or an assembly reference?)
Not. I do not miss the link. If I just type the name of a static class containing the method that it pops up, as well as the extension method. Thnx
source share