C# Generic conditional where clause -


this question has answer here:

i know if possible introduce conditional within clause. example if have 2 generics:

    public static y convert<t, y>(t itemtoconvert)         t : idatatypeconverter, new()         y : idatatypeconverter2, new()     {     }      public static y convert2<t, y>(t itemtoconvert)         t : idatatypeconverter2, new()         y : idatatypeconverter, new()     {     } 

how join them one?

thanks!

make both data type converters inherit same interface. use interface in clause.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -