Skip to content

Instantly share code, notes, and snippets.

@ungood
Created June 24, 2011 20:44
Show Gist options
  • Select an option

  • Save ungood/1045650 to your computer and use it in GitHub Desktop.

Select an option

Save ungood/1045650 to your computer and use it in GitHub Desktop.
public static string GetProductDetails(string id)
{
var reader = blahBlahBlah();
var list = new List<object>();
while(reader.Read())
{
list.Add(new {
Id = reader["Id"],
Name = reader["Name"],
etc...
});
}
var serializer = new JavaScriptSerializer();
serializer.Serialize(list);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment