Skip to content

Instantly share code, notes, and snippets.

@JustinK
Last active August 29, 2015 14:08
Show Gist options
  • Save JustinK/f5821a3e1899d778b2a8 to your computer and use it in GitHub Desktop.
Save JustinK/f5821a3e1899d778b2a8 to your computer and use it in GitHub Desktop.
[WebMethod]
public static List<Type> GetTypeList(string categoryId)
{
var types = new List&ltType&gt
{
new Type(){ Name = "Red", Id=1, CategoryId=5 },
new Type(){ Name = "Blue", Id=2, CategoryId=5 },
new Type(){ Name = "Green", Id=3, CategoryId=3 }
};
var catId = Convert.ToInt32(categoryId);
types = types.Select(p => p.CategoryId == catId).ToList();
return types;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment