Skip to content

Instantly share code, notes, and snippets.

@PaulSorensen
Last active December 23, 2015 23:48
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 PaulSorensen/6712023 to your computer and use it in GitHub Desktop.
Save PaulSorensen/6712023 to your computer and use it in GitHub Desktop.
egeek.dk - WCF return JSON, AJAX-enabled WCF Service in less than 3 minutes
[OperationContract]
public string HelloWorld(string personName)
{
return (new HelloWorldWrapper
{
Response = string.Format("Hello, {0}", personName),
Error = "",
TimeExecuted = DateTime.Now.ToString(CultureInfo.InvariantCulture)
}).ToJson();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment