List.add replacing the all old values with new value

Feb 9 2021 3:35 PM
account_Entites = new account_entites();
dynamic userdetails = JValue.Parse( response.Content.ReadAsStringAsync().Result);
dynamic values = JValue.Parse(userdetails.value.ToString());
foreach(var user in values)
{
if (user.preetham_registrationnumber!= null)
{
account_Entites.preetham_registrationnumber =user.preetham_registrationnumber;
account_Entites.name = user.name;
data_list.Add(account_Entites);   // here for second iteration its replacing old value new value
}
}
}
return data_list;
 
can anybody help me 

Answers (3)