c# create dynamic object
C#
// my pretend dataset
List<string> fields = new List<string>();
// my 'columns'
fields.Add("this_thing");
fields.Add("that_thing");
fields.Add("the_other");
dynamic exo = new System.Dynamic.ExpandoObject();
foreach (string field in fields)
{
((IDictionary<String, Object>)exo).Add(field, field + "_data");
}
// output - from Json.Net NuGet package
textBox1.Text = Newtonsoft.Json.JsonConvert.SerializeObject(exo);
Also in C#:
- Title
- how to cast list to observablecollection c#
- Category
- C#
- Title
- go to next itiration in foreach C#
- Category
- C#
- Title
- get first and last item list c#
- Category
- C#
- Title
- C# foreach loop async but wait at end
- Category
- C#
- Title
- escape double quotes c#
- Category
- C#
- Title
- C# string is all zeros
- Category
- C#
- Title
- unity pro version free download
- Category
- C#
- Title
- unity 2d Drag object
- Category
- C#
- Title
- xml node update attribute value c#
- Category
- C#
- Title
- go right unity
- Category
- C#
- Title
- repeater itemdatabound event in c#
- Category
- C#
- Title
- unity detect any key
- Category
- C#
- Title
- unity accessing 2d pointlight from c# script
- Category
- C#
- Title
- c# update control from another thread
- Category
- C#
- Title
- enums as numbers c#
- Category
- C#
- Title
- unity ui change sprite
- Category
- C#
- Title
- c# skip following code in loop
- Category
- C#
- Title
- unity rotate object c#
- Category
- C#
- Title
- iformfile blobclient
- Category
- C#
- Title
- show double in textbox c#
- Category
- C#
- Title
- how to insert into a list c#
- Category
- C#
- Title
- c# datafield change cell background color
- Category
- C#
- Title
- Could not load file or assembly 'Ubiety.Dns.Core, Version=2.2.1.0
- Category
- C#
- Title
- c# how to take from a float
- Category
- C#
- Title
- .net core download image from url binary file
- Category
- C#
- Title
- c# 2 timespan return yesterday
- Category
- C#
- Title
- C# function return datareader
- Category
- C#
- Title
- c# compile into an exe
- Category
- C#
- Title
- c# superclass constructor
- Category
- C#
- Title
- value is null to insert in c#
- Category
- C#
- Title
- c# convert column name to number
- Category
- C#
- Title
- unity3d debug pause
- Category
- C#
- Title
- eager loading vs lazy loading c#
- Category
- C#
- Title
- c# error "The name 'ViewBag' does not exist in the current context"
- Category
- C#
- Title
- c# remove character from string at index
- Category
- C#
- Title
- mailkit send attachment
- Category
- C#
- Title
- c# replace foreach with lambda
- Category
- C#
- Title
- format string to date only c#
- Category
- C#
- Title
- where keyword in c#
- Category
- C#
- Title
- c# counting lines
- Category
- C#
- Title
- unity rigidbody constraints
- Category
- C#
- Title
- install .net sdk ubuntu 20
- Category
- C#
- Title
- c# how to check if two lists have same values
- Category
- C#
- Title
- HashSet C# append
- Category
- C#
- Title
- c# inotifypropertychanged best practices
- Category
- C#
- Title
- c# try catch error
- Category
- C#
- Title
- set label position winforms
- Category
- C#
- Title
- abstract class c#
- Category
- C#
- Title
- how to track a branch on github
- Category
- C#
- Title
- .net core identity get user id
- Category
- C#
- Title
- nullreferenceexception c#
- Category
- C#
- Title
- unity collider2d contains point
- Category
- C#
- Title
- newtonsoft create dynamic object
- Category
- C#
- Title
- unity indestructible
- Category
- C#
- Title
- page parent wpf
- Category
- C#
- Title
- c# for loop without increment
- Category
- C#
- Title
- unity access child
- Category
- C#
- Title
- asp.net mvc 5 codefirst dropdown list
- Category
- C#
- Title
- c# while loop
- Category
- C#
- Title
- c# int
- Category
- C#
- Title
- c# directories loop
- Category
- C#
- Title
- linq foreach c#
- Category
- C#
- Title
- c# remove spaces from string
- Category
- C#
- Title
- c# generic abstract method
- Category
- C#
- Title
- c# how to add newline on text box
- Category
- C#
- Title
- unitt only 1 number float
- Category
- C#
- Title
- c# display image
- Category
- C#
- Title
- hwo to make an array in C#
- Category
- C#
- Title
- c# get country code
- Category
- C#
- Title
- c# polymorphism
- Category
- C#
- Title
- parsing string to int without format exception c#
- Category
- C#
- Title
- viewBag as a list
- Category
- C#
- Title
- 2d object look at object
- Category
- C#
- Title
- c# generate random number
- Category
- C#
- Title
- autofixture ignore property
- Category
- C#
- Title
- c# get pc ip address
- Category
- C#
- Title
- convert array to list Unity C#
- Category
- C#
- Title
- rotatearound unity
- Category
- C#
- Title
- membership get user id
- Category
- C#
- Title
- c# window instantly close
- Category
- C#
- Title
- how to reference function in unity
- Category
- C#
- Title
- change sprite of gameobject unity
- Category
- C#
- Title
- c# unhandled exception in thread
- Category
- C#
- Title
- json ignore property c#
- Category
- C#
- Title
- c# get foreground window
- Category
- C#
- Title
- C# Into To Tring Debug.Log
- Category
- C#
- Title
- accessing form controls from another class c#
- Category
- C#
- Title
- c# get all inherited classes of a class
- Category
- C#
- Title
- No IUserTwoFactorTokenProvider<TUser> named 'Default' is registered.'
- Category
- C#
- Title
- c# check internet connection easy
- Category
- C#
- Title
- webclient c# example post
- Category
- C#
- Title
- c# httpclient postasync stringcontent
- Category
- C#
- Title
- foreach c#
- Category
- C#
- Title
- set textbox colour to transparent c#
- Category
- C#
- Title
- iframe set html content c#
- Category
- C#
- Title
- c# httpclient azure function authorization
- Category
- C#
- Title
- asp.net list all files in folder
- Category
- C#
- Title
- c# write variable in string
- Category
- C#
- Title
- question mark operator in c#
- Category
- C#
- Title
- unity3d find y position on navmesh
- Category
- C#