У меня есть 3 таблицы, которые представляют собой расписание, расписание и место для консультаций, и я хочу объединить их так, чтобы все данные можно было легко найти
Расписание имеет
1. TimetableID
2. Lecture ID
3. ClassVenue
4. ClassStartTime
5. ClassEndTime
Расписание
1. ScheduleID
2. LectureID
3. ScheduleVenue
4. ScheduleStartTime
5. ScheduleEndTime
Слот для консультаций
1. ConsultationID
2. LectureID
3. StudentID
4. ScheduleID
5. remark
Вот мой код в метаданных
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.Schedules On c.ScheduleID Equals s.ScheduleID 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.ScheduleStartTime, _
.scEndTime = s.ScheduleEndTime, _
.scID = s.ScheduleID, _
.scVenue = s.ScheduleVenue, _
.ttID = t.TimeTableID, _
.ttClassVenue = t.ClassVenue, _
.ttClassStartTime = t.ClassStartTime, _
.ttClassEndTime = t.ClassEndTime}
Return CSC
End Function
У меня ошибка на c.LectureID = s.LectureID = t.LectureID
Я хочу получить комбинацию из 3 таблиц через lectureID, поскольку на 3 таблицах есть идентификатор лекции.Кто-нибудь помогает пожалуйста.