Skip to content

Instantly share code, notes, and snippets.

@JakeGinnivan
Created January 10, 2012 10:06
Show Gist options
  • Save JakeGinnivan/1588317 to your computer and use it in GitHub Desktop.
Save JakeGinnivan/1588317 to your computer and use it in GitHub Desktop.
[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