Advertisement
simonradev

04. Ime na zadacha

Oct 14th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. public class Persist
  6. {
  7.     public static void Main()
  8.     {
  9.         var anon = new
  10.         {
  11.             Name = "Pesho"
  12.         };
  13.  
  14.         Print(anon);
  15.     }
  16.  
  17.     private static void Print(dynamic item)
  18.     {
  19.         Console.WriteLine(item.Aasd);
  20.     }
  21. }
  22.  
  23. public class Person
  24. {
  25.     public Person(string name)
  26.     {
  27.         this.Name = name;
  28.     }
  29.  
  30.     public string Name { get; set; }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement