Linq Sum 动态参数

Linq Sum dynamic parameter

Func<FooEntity, double> selector = null;
selector = x => x.M1_TotalLoss;

var entity = FooEntity
    .Where(x => x.Year == year)
    .GroupBy(gp => gp.Year)
    .Select(ss => new FooDto
    {
        SumTotalLoss = ss.Sum(selector)
    })
    .FirstOrDefaultAsync();

我需要求和动态选择器。

错误 = 内部 .NET Framework 数据提供程序错误 1025。

ss.AsQueryable().Sum(selector)