Skip to content

Instantly share code, notes, and snippets.

@ronnieoverby
Created April 6, 2014 20:18
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 ronnieoverby/10011035 to your computer and use it in GitHub Desktop.
Save ronnieoverby/10011035 to your computer and use it in GitHub Desktop.
public interface IFoo
{
[Sql("select 1")]
int GetNumber();
}
public interface IBar
{
[Sql("select 2")]
int GetNumber();
}
public interface IQux : IFoo, IBar
{
[Sql("select 'Test'")]
string GetString();
}
// later...
[Test]
public void Test1()
{
using (var conn = GetConnection())
{
var db = conn.As<IQux>();
var n1 = (db as IFoo).GetNumber(); // 1
var n2 = (db as IBar).GetNumber(); // 1
var s = db.GetString(); // "Test"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment