1
I have a list and I want that after the foreach
from that list, remove all elements from it, the method RemoveAll()
asks parameter, but I don’t know which parameter to pass.
foreach (var lista in ListaContatos)
{
lista.Con_codigo = agenciaModel.Bcx_codigo;
lista.Con_tpcadastro = Con_tpcadastro;
var stringContent2 = new StringContent(JsonConvert.SerializeObject(lista), Encoding.UTF8, "application/json");
using (HttpResponseMessage response = await httpClient.PostAsync(UrlApi2, stringContent2))
{
response.EnsureSuccessStatusCode();
}
}
ListaContatos.RemoveAll();
Some difficulty in using the method
Clear()
?– Maniero