Open cmshawns opened 11 years ago
LINQ research:
from s in Vw_Class
//join l in Vw_ClassCluster on string.Concat(s.ClusterItemNumber, s.YearQuarterID) equals l.ClassClusterID
where s.ClassID == "3545B124"
select new {
s.ClassID,
IsClustered = s.ClusterItemNumber != null,
SeatsAvailable = s.ClusterItemNumber != null ?
Vw_ClassCluster.Where(l => string.Concat(s.ClusterItemNumber, s.YearQuarterID) == l.ClassClusterID)
.Select (l => l.ClusterCapacity - l.ClusterEnrolled)
.First()
: s.ClassCapacity - s.StudentsEnrolled,
s.ClassCapacity,
s.StudentsEnrolled,
// l.ClusterCapacity,
// l.ClusterEnrolled,
}
This was done directly in the database for the Class Schedule app, but we still should include this logic in the API.
In ODS: