Take the 2-minute tour ×  Is there an easy way to create and
Object and set properties in C# like you can in Javascript.
Example Javascript:  var obj = new Object;  obj.value = 123476;
obj.description = "this is my new object"; obj.mode = 1;
share|improve this question Errm, do you mean creating an object
in general or creating an actual System.Object and adding
properties dynamically? –  Yuck Jul 8 '11 at 14:29 add comment
4 Answers  up vote 12 down vote accepted  try c# anonymous
classes  var obj = new {      value = 123475,      description =
"this is my new object",      mode = 1 };  there are lots of
differences though...  @Valera Kolupaev & @GlennFerrieLive
mentioned another approach with dynamic keyword  share|improve
this answer add comment  In case, it you want to create un-tyed
object use ExpandoObject.  dynamic employee, manager;  employee
= new ExpandoObject(); employee.Name = "John Smith";
employee.Age = 33;  manager = new ExpandoObject(); manager.Name
= "Allison Brown"; manager.Age = 42; manag