Skip to content

Instantly share code, notes, and snippets.

@pawelpabich
Created May 12, 2016 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawelpabich/673c8a5c0081d66c6842e0644240e75a to your computer and use it in GitHub Desktop.
Save pawelpabich/673c8a5c0081d66c6842e0644240e75a to your computer and use it in GitHub Desktop.
Same name
using System;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(new Test().GetExtension());
Console.ReadLine();
}
}
public class Test : ITest
{
protected string Get()
{
return "works";
}
string ITest.Get()
{
return Get();
}
}
public interface ITest
{
string Get();
}
public static class TestExtensions
{
public static string GetExtension(this ITest test)
{
return test.Get();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment