Skip to main content
added 209 characters in body
Source Link
stmax
  • 6.6k
  • 4
  • 31
  • 47

try this might work:

string GetString<T>(List<T> list) where T : IEntityCore {...}

that way you get a generic method that takes a list of objects which implement IEntityCore. there's no need to cast and the compiler will make sure that you pass in the right objects. works starting at framework 2.0.

this might work:

string GetString<T>(List<T> list) where T : IEntityCore {...}

try this:

string GetString<T>(List<T> list) where T : IEntityCore {...}

that way you get a generic method that takes a list of objects which implement IEntityCore. there's no need to cast and the compiler will make sure that you pass in the right objects. works starting at framework 2.0.

Source Link
stmax
  • 6.6k
  • 4
  • 31
  • 47

this might work:

string GetString<T>(List<T> list) where T : IEntityCore {...}