-2

Can someone give example how to "define classes such that there will be only one Product object and multiple Product Details objects in c#"?

Shakeer Hussain
  • 2,230
  • 7
  • 29
  • 52
  • We're not a code writing service. We're here to help you with your code. Please have a go and post what you come up with. We can then help you fix it if there's a problem. – Enigmativity Aug 25 '16 at 05:12

1 Answers1

2

Without knowing more information:

public class Product {
   public Product() {
      Details = new List<ProductDetails>();
   }
   public string Name {get; set;}
   public ICollection<ProductDetails> Details {get; private set;}
}

public class ProductDetails {
   public string SomeDetailedText {get; set;}
}
Benjewman
  • 498
  • 4
  • 14