c# - Generic class definition with both generic type constraint and inherited type? -


i wondering if possible have both generic type constraint , inherited type?

i not figure syntax out myself or think of possible example at.

code example:

public class test<t> t : itest, new() : ibasetest {  } 

is possible achieve class definition this?

public class test<t> : ibasetest t : itest, new() { }

your class implement interface ibasetest, , generic parameter t constrained types implementing interface itest , having default (parameterless) constructor.

is meant?


Comments

Popular posts from this blog

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

javascript - Iterate over array and calculate average values of array-parts -

jQuery Ajax Render Fragments OR Whole Page -