fork download
  1. public class Program {
  2. public static void Main() {
  3. var myClassObject = new MyClass() { Prop1 = "Teste", Prop2 = 10, FieldArray = new Field<dynamic>[2] { new Field<dynamic>("f1", "v1"), new Field<dynamic>("f1", 1) } };
  4. }
  5. }
  6.  
  7. public class Field<TValue> {
  8. public string Name { get; set; }
  9. public TValue Value { get; set; }
  10.  
  11. public Field() {}
  12.  
  13. public Field(string name, TValue value) {
  14. this.Name = name;
  15. this.Value = value;
  16. }
  17. }
  18.  
  19. public class MyClass {
  20. public string Prop1 { get; set; }
  21. public int Prop2 { get; set; }
  22. public Field<dynamic>[] FieldArray { get; set; }
  23. }
  24.  
  25. //https://pt.stackoverflow.com/q/241121/101
Success #stdin #stdout 0.02s 13932KB
stdin
Standard input is empty
stdout
Standard output is empty