-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I've got an interresting problem: Given an IEnumerable<string>, is it possible to yield a sequence of IEnumerable<string> that groups identical adjacent strings in one pass?
Let me explain.
Considering the following IEnumerable<string> (pseudo representation):
{"a","b","b","b"…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
How to split an IEnumerable of IEnumerables to one flat IEnumerable using LINQ (or someway else)?
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
In the .net framework, there's a generic IEnumerable<T> interface which inherits from the not-generic IEnumerable, and they both have a GetEnumerator() method. The only differents between these two GetEnumerator() is the return type.
Now I have a similar design, but when I compile the…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
I get an IEnumerable which I know is a object array. I also know the datatype of the elements. Now I need to cast this to an IEnumerable<T, where T is a supplied type. For instance
IEnumerable results = GetUsers();
IEnumerable<T> users = ConvertToTypedIEnumerable(results, typeof(User));
I…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi All,
Recently I found a very surprising behavior in c#.
I had a method which takes IEnumerable<Object> as a parameter and i was passing
IEnumerable<string> but it's not possible.
While in c# everything can be upcast to Object than why this is not possible?
It's totally confusing for…
>>> More