Created
August 29, 2022 19:33
-
-
Save andrebaltieri/3894495efb1025d86d8b8c9cef168300 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var minhaLista = new List<Food> { | |
new Food { Type = "Mineira"}, | |
new Food { Type = "Italiana"}, | |
new Food { Type = "Japonesa"} | |
}; | |
for (int i = 0; i <= minhaLista.Count; i++) | |
{ | |
var item = minhaLista[i]; | |
Console.WriteLine(item.Type); | |
} | |
foreach (var item in minhaLista) | |
{ | |
Console.WriteLine(item.Type); | |
} | |
public class Food | |
{ | |
public string Type { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment