Working with Visual Studio 2015
I have a list to which I want to update from a list B
foreach (var item in entity.ProductoCatalogos)
{
foreach (var asignado in _listProductoCatalogos)
{
asignado.ProductoCatalogoId = item.ProductoCatalogoId;
asignado.Id = item.CatalogoId;
}
}
I have two records in each list I have noticed that you assign me the data four times that it enters the second foreach
what I expected is that as I have 2 records between only two times.
What am I doing wrong?
Greetings!