Trying to return a distinct list of SubString in LINQ.
This is returning the list but there are 100 records with the substring. I only want to return the distinct list.
var query = from b in db.Certificates
select b.CertificateNumber.Substring(0,4);
ViewBag.BoxNumber = new SelectList(query.ToList());
I tried adding the distinct as in
select b.CertificateNumber.Substring(0,4).Distinct();
But it threw
DbDistinctExpression requires a collection argument.