Looking at the source the problem would appear to be a combination of a couple of things.
As @Parv has already pointed out the reason you get the []
is because your class implements IEnumerable
so the serializer attempts to iterate the object and then serialize each item independently. Your current design is not going to work as it isn't designed to serialize public properties for types that implement IEnumerable
.
The other issue, like I mentioned in a comment, is the your class doesn't appear to have any public properties, what you have at the moment are public variables. In order for the serializer to work you need property setter/getters i.e.
public class dg
{
public int id { get; set; }
public string title { get; set; }
...
}