I created a list object of class and after that m updating its value its value not updating please help me here is my code
public class LocationData
{
public int LocId { get; set; }
public string LocatinName { get; set; }
public int ControlCount { get; set; }
public Nullable<short> KeyType { get; set; }
public Nullable<short> Financial_Reporting { get; set; }
public Nullable<short> FraudRisk { get; set; }
public Nullable<short> FinancialControl { get; set; }
public Nullable<short> ELC { get; set; }
}
var locList = location.Select(a =>
new LocationData { LocatinName = a.Location, LocId = a.LocID });
after that I'm trying to update the value in this:
locList.Where(a => a.LocId == 7).ToList()
.ForEach(b => b.ControlCount = b.ControlCount + 1);
but nothing is updated i also try this but not updated
(from loc in locList select loc).ToList().ForEach((loc) =>
{
loc.ControlCount = loc.ControlCount + 1;
});