Created
April 6, 2014 20:18
-
-
Save ronnieoverby/10011035 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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