Guest User

Untitled

a guest
Jul 18th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. public partial class ExpSections
  2. {
  3. public ExpSections()
  4. {
  5. ExpRemarks = new HashSet<ExpRemarks>();
  6. }
  7. public int ExpSectionId { get; set; }
  8. public int ExpMainId { get; set; }
  9. public string Name { get; set; }
  10. public string ExpertName { get; set; }
  11. public string ImageName { get; set; }
  12.  
  13. public ExpMains ExpMain { get; set; }
  14. public ICollection<ExpRemarks> ExpRemarks { get; set; }
  15. }
  16.  
  17. public partial class ExpRemarks
  18. {
  19. public int ExpRemarkId { get; set; }
  20. public int ExpSectionId { get; set; }
  21. public string Number { get; set; }
  22. public string Question { get; set; }
  23. public string Answer { get; set; }
  24. public string Check { get; set; }
  25.  
  26. public ExpSections ExpSection { get; set; }
  27. }
  28.  
  29. public IActionResult Method(int id)
  30. {
  31. ExpSections expSections = _bd.ExpSections.SingleOrDefault(m=>m.ExpSectionId == id);
  32.  
  33. Console.WriteLine(expSection.ExpRemark.Count());
  34.  
  35. _bd.ExpSections.Include(x => x.ExpRemarks)
  36. .SingleOrDefault(m=>m.ExpSectionId == id);
  37.  
  38. public virtual ICollection<ExpRemarks> ExpRemarks { get; set; }
Add Comment
Please, Sign In to add comment