Created
June 10, 2012 04:13
-
-
Save jmarnold/2903804 to your computer and use it in GitHub Desktop.
Continuation payloads
This file contains hidden or 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 static class AjaxContinuationExtensions | |
{ | |
public const string TOPIC = "topic"; | |
public const string PAYLOAD = "payload"; | |
public static AjaxContinuation SetPayload(this AjaxContinuation continuation, string topic, object payload) | |
{ | |
continuation[PAYLOAD] = payload; | |
continuation[TOPIC] = topic; | |
return continuation; | |
} | |
public static string Topic(this AjaxContinuation continuation) | |
{ | |
return continuation[TOPIC] as string; | |
} | |
public static T GetPayload<T>(this AjaxContinuation continuation) where T : class | |
{ | |
return continuation[PAYLOAD] as T; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment