daily pastebin goal
18%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class foo
  2. {    
  3.     public int id {get; set;}
  4.  
  5.     public string name{ get; set; }
  6.  
  7.     public ICollection<bar> bar{ get; set; }
  8. }
  9.    
  10. public class bar
  11. {
  12.     public int id {get; set;}
  13.  
  14.     public string name{ get; set; }
  15. }
  16.    
  17. foo fooexample = new foo();
  18. foreach (var object in exceldata)
  19. {
  20.     fooexample.id = exceldata.id;
  21.     fooexample.bar.id = exceldata.bar.id;
  22.     // <-- how do I do this? if I need to initialize it, how?
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top