无法在 Linq 中选择特定列出现此错误
无法从“System.Collections.Generic.IEnumerable<AnonymousType#1>”转换为“System.Linq.ParallelQuery<LINQ.SalesTaxRate>”
private void Button_Click_7(object sender, RoutedEventArgs e)
{
using (LinqContainer context = new LinqContainer())
{
List<SalesTaxRate> salesTaxRateList = (from c in context.SalesTaxRates
select new {c.TaxRate })
.ToList<SalesTaxRate>();
grid.ItemsSource = salesTaxRateList;
}
}