我有一个包含两列的表,像这样的州和贷款
State loan
NJ 100
CA 200
NJ 150
CT 300
CT 100
我想使用linq按州分组贷款。我这样做但是没有用
var query = from address in context.data_vault.ToList()
group address by address.STATE into addressGroup
select new
{
State = addressGroup.Key,
count = addressGroup.Count()
};
我也需要分页结果。
请建议我怎么做