I'm trying to send a JSON message to facebook that they call a game.achievement but I wanted to create the object using an AnonymousType before Posting. The problem is one of the fields is "game:points" (with the colon). As you can see I've used the @ prefix for the object field but it doesn't work for the game:points field. It gets underlined in red and won't compile.
var paramsJson = new
{
privacy = new { value = "ALL_FRIENDS" },
@object = new
{
app_id = "my app id",
type = "game.achievement",
title = "Test",
@"game:points" = 100,
description = "Test",
image = "img.png"
}
};
I've tried many varieties of @, double quotes etc. Is it possible or do I need to just use a StringBuilder for this?