10 TIPs - To Become a Good Developer/Programmer
Why Join
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
ahmed salah
1.6k
530
119k
How to represent many to many relation between student&class
Nov 15 2016 8:06 PM
Problem
I have two table Student and class many to many relationship
Student Table but i dont know how to represent Classroom_Student class in code .
Student Class
namespace
UniversityData.Models
{
[Table(
"Student"
)]
public
partial
class
Student
{
public
Student()
{
this
.Classes =
new
HashSet();
}
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public
int
StudentID {
get
;
set
; }
[Required]
[StringLength(50)]
public
String StudentName {
get
;
set
; }
public
ICollection Classes {
get
;
set
; }
}
}
ClassRoom Table
namespace
UniversityData.Models
{
[Table(
"Class"
)]
public
partial
class
Class
{
public
Class()
{
this
.Students =
new
HashSet();
}
[Key]
public
int
ClassID {
get
;
set
; }
[Required]
[StringLength(50)]
public
string
ClassName {
get
;
set
; }
public
ICollection Students {
get
;
set
;}
}
}
Classroom_Student
StudID
ClassID
starttime
endtime
day
What i do as following
Create class for Student Table and class for ClassRoom Table
but Classroom_Student Table cannot do class for him
how to do class for Classroom_Student Table .
Reply
Answers (
9
)
bootstrap fullcalendar with asp.net c#
Non Action and child action method in ASP.NET MVC.