Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Dynamic properties in Dynamic object
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here var list = new List<string>(); list.Add("car"); list.Add("bike"); list.Add("boat"); list.Add("lorry"); dynamic test = new System.Dynamic.ExpandoObject(); IDictionary<string, object> myUnderlyingObject = test; foreach(var v in list){ myUnderlyingObject.Add(v, v); } Console.WriteLine(test.car); Console.WriteLine(test.bike); Console.WriteLine(test.boat); Console.WriteLine(test.lorry); } } }
run
|
edit
|
history
|
help
0
c# string abbreviation
Conditional linq operators
ternary function
dsadsadsa
RHGFEC WQWQW
Output to get sum = 5 in given array of integers
Lambda Expressions Are Cool
Ki
C++
page 2