Can someone give example how to "define classes such that there will be only one Product object and multiple Product Details objects in c#"?
Asked
Active
Viewed 47 times
-2
-
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 Answers
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;}
}
Ben
- 488
- 5
- 14