19 Replies
We have to use the IComparer like in this example
this is my code
this is the error
currently
RatingComparer
implements Domein.IComparer<Domein.Movie>
, but instead it should implement System.Collections.Generic.IComparer<Domein.Movie
And how can I do this?
remove
Domein.IComparer<T>
completely, the linq functions expect a System.Collections.Generic.IComparer<T>
I cant see da domein.IComparer<T> i this code
its implicitly using
IComparer <Movie>
from Domein
So I have to remove a using statement?
if you want to use the other one, you need to specify it with the full path, since your own namespace is implicitly preferred over the other one
a using domain?
that would work
probably
but you should remove your definition of
Domein.IComparer<T>
completely, you dont need it for anythingBut where in my code is the definition xp in my RatingComparer class or in the interface
movies.Sort
method expects a System.Collections.Generic.IComparer<T>
, your comparer class must implement that
it doesnt accept a Domein.IComparer<T>
, because the base class library doesnt know about your typesok it works, but why having "using System.Collections.Generic;" if we still need to type it full
because the name conflicts with
Domein.IComparer<T>
So I have to IComparers. Hmmm idk thank your for your help alex 😄 I'll take some time to process it xp