Creating a dynamic object with properties C# with Example



Creating a dynamic object with properties C# with Example

using System; 
using System.Dynamic; 
dynamic info = new ExpandoObject(); 
info.Id = 123; 
info.Another = 456; 
Console.WriteLine(info.Another); 
// 456 
Console.WriteLine(info.DoesntExist); 
// Throws RuntimeBinderException 

0 Comment's

Comment Form

Submit Comment