LINQ is a collection in ,net Framwork.to sum the value and display on controller we using linq.
添加
using System.Collections.Generic;
因为 Linq 属于 .Collection
2.然后找到数据object.
private readonly IRepository Repository;
3. 然后在create method
添加
var total = mayoanswerRepository.AllIncluding(value => value.Value).Sum(m => m.Value);
toal 属于int data type
sum 属于int Iqueryable
等式成立