func-delegate

How to specify .NET Anonymous object return type in Linq using Func<T,Q>?

How do you specify the Func signature for anonymous objects? new Func<DataSet, **IEnumerable<int>>** I am having a trouble with return type where I have specified as IEnumerable<> in the Func declaration Error I am getting from the expression is Cannot convert expression type 'System.Collections.Generic.IEnumerable<{ParentNodeId...

How do you return a copy of original List<T> from Func<T, TResult>?

I have found out (in a hard way) that a collection that is being enumerated cannot be modified within "Foreach" statement "Collection was modified; enumeration operation may not execute." Now, the solution I came up with is to create a dummy collection of the same size that contains a dictionary key and enumerate over it to modify ...

Multiple generic types in one container

I was looking at the answer of this question regarding multiple generic types in one container and I can't really get it to work: the properties of the Metadata class are not visible, since the abstract class doesn't have them. Here is a slightly modified version of the code in the original question: public abstract class Metadata { } ...