Skip to content

Instantly share code, notes, and snippets.

@bennage
Created October 2, 2009 03:00
Show Gist options
  • Save bennage/199431 to your computer and use it in GitHub Desktop.
Save bennage/199431 to your computer and use it in GitHub Desktop.
public IEnumerable<IResult> DoSomethingBaseOnType(SomeBaseClass item)
{
var function = _typeToFunction[item.GetType()];
foreach (var result in function(item))
{
yield return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment