Created
January 10, 2012 10:06
-
-
Save JakeGinnivan/1588317 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
[ServiceContract] | |
public interface IService | |
{ | |
[OperationContract] | |
void Something(); | |
[OperationContract] | |
SomeRespose SomethingElse(); | |
} | |
//t4 templates then generate: | |
public interface IServiceAsync | |
{ | |
Task Something(); | |
Task<SomeRespose> SomethingElse(); | |
} | |
//We then request for a IServiceAsync in our ctors, which invokes a async proxy generator, which uses linfu and a interceptor to proxy IServiceAsync. When this proxy is generated, the real proxy is created via channel factory too, and this is what the AsyncProxy calls | |
// WHen you call await Something(), it basically is: | |
TaskEx.Run(()=>proxy.Something()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment