Guest User

Untitled

a guest
Aug 10th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment