You should avoid foreach loops like this, it will cause more queries to be executed, more data to be fetched from SQL and LINQ can't optimize queries.
If you write it like this:
from p in db.Purchases where p.Customer.Active.Equals(true) select new {p.Id, p.Name}
it will be a single query fetching only two required columns.