private void Top3Cheapest_Click(object sender, EventArgs e) { var query = from c in pContext.Categories orderby c.Products.Min(p => p.UnitPrice) select c; var top3query = query.Take(3); var top3Form = new Top3(top3query, "Cheapest Product Categories"); top3Form.ShowDialog(); }
private void Top3Most_Click(object sender, EventArgs e) { var query = from c in pContext.Categories orderby c.Products.Count descending select c; var top3query = query.Take(3); var top3Form = new Top3(top3query, "Most Products Categories"); top3Form.ShowDialog(); }