TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
98
42.2k
Reference Foreign Key with 3 Foreign Key But 1 Table
Jan 13 2020 11:13 PM
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
; }
}
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?
Reply
Answers (
5
)
defining connection in class file
how to open 2 dashboard 1 for admin and 1 for user in mvc