Skip to content

Instantly share code, notes, and snippets.

@Kritner
Created December 21, 2016 17:30
Show Gist options
  • Save Kritner/b558e7f9a4da28d97e2318ac1a02a781 to your computer and use it in GitHub Desktop.
Save Kritner/b558e7f9a4da28d97e2318ac1a02a781 to your computer and use it in GitHub Desktop.
Generics vs interfaces? What does it get me?
public interface IFoo { }
public class Something<TFoo>
where TFoo : IFoo
{
public void DoSomething(TFoo foo)
{
}
}
public interface IFoo { }
public class Something
{
public void DoSomething(IFoo foo)
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment