我有这个错误,我想要解决.
operator '-' cannot be applied to operands of type 'decimal' and 'Systems.Collections.Generic.IEnumerable<decimal>
我的代码:
// Step 5: Retrieve MPR amount and deduct form Gross Tax Dictionary Per-Employee //Query database var taxtable = taxTableService.GetAllTaxTables(); var mprAmount = (from tt in taxtable select tt.U_MPR_amount).distinct(); Dictionary<int,decimal> paye = new Dictionary<int,decimal>(); grosstaxDictionary.ToList().ForEach(x => { var totalPAYE = x.Value - mprAmount; paye.Add(x.Key,totalPAYE); });
在我的数据库中,字段U_MPR_amount是小数,因此是x.Value.
可能是什么问题呢?任何帮助赞赏.