I have the following function to get validation errors for a card. My question relates to dealing with GetErrors. Both methods have the same return type IEnumerable<ErrorInfo>. private static...
I have a method that returns an IEnumerable<KeyValuePair<string, ArrayList>>, but some of the callers require the result of the method to be a dictionary. How can I convert the...
I have two instances of IEnumerable<T> (with the same T). I want a new instance of IEnumerable<T> which is the concatenation of both. Is there a built-in method in...
I know it’s possible to cast a list of items from one type to another (given that your object has a public static explicit operator method to do the...
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only...
This question already has answers here: Casting IEnumerable<T> to List<T> (6 answers) Closed 5 years ago. I want to convert from IEnumerable<Contact> to List<Contact>. How can I do this?...
I have an IEnumerable<T> method that I’m using to find controls in a WebForms page. The method is recursive and I’m having some problems returning the type I want...
private IEnumerable<string> Tables { get { yield return "Foo"; yield return "Bar"; } } Let’s say I want iterate on those and write something like processing #n of #m....
Given the following code and the suggestions given in this question, I’ve decided to modify this original method and ask if there are any values in the IEnumarable return...
Is there a common way to pass a single item of type T to a method which expects an IEnumerable<T> parameter? Language is C#, framework version 2.0. Currently I...