- public class Category
- {
- public Guid Id { get; set; }
- public string Name { get; set; }
- }
- public class Product
- {
- public Guid Id { get; set; }
- public Guid CategoryId2 { get; set; }
- public Guid CategoryId3 { get; set; }
- public string Code { get; set; }
- public string Name { get; set; }
- [ForeignKey("Category")]
- public Guid CategoryId1 { get; set; }
- public virtual Category Category { get; set; }
- }
Reference Foreign Key with 3 Foreign Key But 1 Table
I have these 2 tables. The Product has 3 foreign key which I need to connect in Category. I only sure about the CategoryId1 but I dont know what to do in CategoryId2 and CategoryId3. what should I do?
Guest UserPosted Jan 15, 2020, 1:15 PM
Laxmidhar SahooPosted Jan 15, 2020, 12:07 PM
Guest UserPosted Jan 14, 2020, 8:44 PM
Guest UserPosted Jan 14, 2020, 12:24 AM
Madan ShekarPosted Jan 13, 2020, 11:48 PM
ID Productname CategoryID