c# - Passing Generic List into SelectLista -


I know that you can not go into a non-IEnumerable based object in an ASP.NET MVC SelectList helper method (as It is expected that the first one for the first IEnumerable ) I have a generic list list & lt; OurCustomType & gt; and OurCustomType has properties for things like dropdown value etc.

So if I can not go into the normal object for an IEnumerable, if I still want to use the SelectList assistant, what other options do I have here?

IEnumerable & lt; T & gt; extension IEnumerable , hence the list & lt; T & gt; already applies to IEnumerable . it should be fine. For example:

  list & lt; Int & gt; General list = new list & lt; Int & gt; (); IEnumerable & LT; Integer & gt; Generic Sepenance = Generic List; IEnumerable weakSequence = generic;  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -