How do I take the first record in the following code?
subscription_end = (from ss in School_subs
.Where (s => s.School_id == sc.School_id)
select ss.End_date)
Here is the entire query that works in LinqPad:
var query = ((from sc in Schools.Where(s => s.Active == 1)
select new
{
sc,
teletardy_active = (from tt in Teletardies
.Where(t => t.School_id == sc.School_id)
select tt.Active),
district_name = (from dd in Districts
.Where (d => d.District_id == sc.District_id)
select dd.District_name),
subscription_end = (from ss in School_subs
.Where (s => s.School_id == sc.School_id)
select ss.End_date)
}
).OrderBy(o => o.sc.School_name));
query.Dump();