c# - Collecting types that implement a particular interface without casting? -


Actually, I want to know that in all the special namespaces, all types of specific interface such as IEnumerable apply We do.

I know what I can do:

  foreach type ... if type is IEnumerable ...  

But I do not want to type just to type if it applies an interface, because the artist will be thrown in any way.

itemprop = "text">

is is not an artist, it is an exam, which you like looks like. Casting typing in C # is either done using forced clipping operators (name?):

  (IEnumerable someCollection)  

Or Safe Casting Operator:

  IEnumerable as some Convolance  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -