I have 3 table which are Timetable, 表格 and Consultation slot and i wish to combine them so that all the data are able to retrieve easily
时间表
1. TimetableID
2. Lecture ID
3. ClassVenue
4. ClassStartTime
5. ClassEndTime
表格
1. 表格ID
2. LectureID
3. 表格Venue
4. 表格StartTime
5. 表格EndTime
磋商时间
1. ConsultationID
2. LectureID
3. StudentID
4. 表格ID
5. remark
Here is my code in metadata
Partial Public Class CombinationOfTSC
<Key()> _
Public Property LectureID() As String
Get
Return m_LectureID
End Get
Set(value As String)
m_LectureID = value
End Set
End Property
Private m_LectureID As String
Public Property StudentID() As String
Get
Return m_StudentID
End Get
Set(value As String)
m_StudentID = value
End Set
End Property
Private m_StudentID As String
Public Property ttID() As String
Get
Return m_ttID
End Get
Set(value As String)
m_ttID = value
End Set
End Property
Private m_ttID As String
Public Property ttClassVenue() As String
Get
Return m_ttClassVenue
End Get
Set(value As String)
m_ttClassVenue = value
End Set
End Property
Private m_ttClassVenue As String
Public Property ttClassStartTime() As DateTime
Get
Return m_ttClassStartTime
End Get
Set(value As DateTime)
m_ttClassStartTime = value
End Set
End Property
Private m_ttClassStartTime As DateTime
Public Property ttClassEndTime() As DateTime
Get
Return m_ttClassEndTime
End Get
Set(value As DateTime)
m_ttClassEndTime = value
End Set
End Property
Private m_ttClassEndTime As DateTime
Public Property scID() As String
Get
Return m_scID
End Get
Set(value As String)
m_scID = value
End Set
End Property
Private m_scID As String
Public Property scVenue() As String
Get
Return m_scVenue
End Get
Set(value As String)
m_scVenue = value
End Set
End Property
Private m_scVenue As String
Public Property scStartTime() As DateTime
Get
Return m_scStartTime
End Get
Set(value As DateTime)
m_scStartTime = value
End Set
End Property
Private m_scStartTime As DateTime
Public Property scEndTime() As DateTime
Get
Return m_scEndTime
End Get
Set(value As DateTime)
m_scEndTime = value
End Set
End Property
Private m_scEndTime As DateTime
Public Property cID() As String
Get
Return m_cID
End Get
Set(value As String)
m_cID = value
End Set
End Property
Private m_cID As String
Public Property cRemark() As String
Get
Return m_cRemark
End Get
Set(value As String)
m_cRemark = value
End Set
End Property
Private m_cRemark As String
End Class
在我的领域类别中,该守则将成为法典。
Public Function GetCoTSC(lectureID As String) As IQueryable(Of CombinationOfTSC)
Dim CSC As IQueryable(Of CombinationOfTSC) = From c In ObjectContext.ConsultationSlots Join s In ObjectContext.表格s On c.表格ID Equals s.表格ID Join t In ObjectContext.TimeTables On t.LectureID Equals s.LectureID Where c.LectureID = s.LectureID = t.LectureID Select New CombinationOfTSC() With { _
.cID = c.ConsultationID, _
.cRemark = c.Remark, _
.StudentID = c.StudentID, _
.LectureID = s.LectureID, _
.scStartTime = s.表格StartTime, _
.scEndTime = s.表格EndTime, _
.scID = s.表格ID, _
.scVenue = s.表格Venue, _
.ttID = t.TimeTableID, _
.ttClassVenue = t.ClassVenue, _
.ttClassStartTime = t.ClassStartTime, _
.ttClassEndTime = t.ClassEndTime}
Return CSC
End Function
I m having error at c.LectureID = s.LectureID = t.LectureID
I wish to get the combination of 3 tables through the lectureID since there are lecture ID on 3 tables.
Anyone helps pls.