c# - JObject formatting (json.net) -


i'm trying tables json string (just example)

  datatable table = new datatable();   table.columns.add("name", typeof(string));   table.rows.add( "david");    var result = row in table.asenumerable()        select new        {  name = (string)row["name"] };   jobject json = jobject.fromobject(new                                  {result});   return json ; 

i'm getting :

"table":{"result":[{"name":"david"}]} 

but need this:

"result":[{"name":"david"}] 

is there ways format string , rid of "table"/"result"/etc, combining them in 1 ? (may not json.net?)

i figure out. needed use jsonconvert.serializeobject instead of jobject


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -