Public Class MyList
{
Public double
Amount{get;set;}
}
//in controllerList<MyList>
myList=new
List<MyList>();
myList.add(new
List<MyList>()
{
Amount=10,
}
);
myList.add(new
List<MyList>()
{
Amount=20,
}
);
double total = myList.Sum(item => item.Amount);
No comments:
Post a Comment