, .
, TResult ( Alfie Goodacre), IEnumerable<out T> T, Func<in T1, out TResult> TResult.
, :
public IEnumerable<MyType> DoSomething(Func<MyType, AnotherType> func)
public IEnumerable<MyType> DoSomething(Func<MyType, IEnumerable<AnotherType>> func)
- , , AnotherType .
:
public IEnumerable<MyType> DoSomething<TResult>(Func<MyType, TResult> func)
where TResult : AnotherType
public IEnumerable<MyType> DoSomething<TResult>(Func<MyType, IEnumerable<TResult>> func)
where TResult : AnotherType
, . , AnotherType interface, TResult - struct ( ), , , (out T out TResult).