I'm quite new to C#, and have two questions regarding generic lists and extension methods. Sorry if the questions are a bit stupid..
What is the difference between:
public static IObjectWithTempID FindByTempID
(this ObservableCollection<IObjectWithTempID > list, long tempID)
and
public static IObjectWithTempID FindByTempID< E >
(this ObservableCollection< IObjectWithTempID > list, long tempID)
I have tried to read up on the subject, but still don't understand :$
I have run into a strange issue. When I declare an ObservableCollection
, such as this
ObservableCollection<TestObjectWithTempID> a =
new ObservableCollection<TestObjectWithTempID>();
it is possible to call extension method
public static long FindByTempID
(this IEnumerable< IObjectWithTempID > list, long tempID){}
on the list. It is surprisingly not possible to call extension method
public static long FindByTempID
(this ObservableCollection< IObjectWithTempI D> list, long tempID){}
though. What have I missed here?