what can be wrong. it works properly untill I add new property 'Country' then add-migration. and how in screen I add for all team objects a country and create new team. rebuild. update-database and i get mistake
public static List<Team> GetTeams()
{
List<Team> teams = new List<Team>()
{
new Team()
{
TeamName = "Canucks",
City = "Vancouver",
Province = "BC",
Country = "Canada"
},
new Team()
{
TeamName = "Oilers",
City = "Edmonton",
Province = "Alberta",
Country = "Canada"
},
new Team()
{
TeamName = "Flames",
City = "Calgary",
Province = "Alberta",
Country = "Canada"
},
new Team()
{
TeamName = "Sharks",
City = "San Jose",
Province = "California",
Country = "USA"
}
};
return teams;
}
the place with new property loocks like this:
public class Team
{
[Key]
[MaxLength(10)]
public string TeamName { get; set; }
public string City { get; set; }
public string Province { get; set; }
public string Country { get; set; }
public List<Player> Players { get; set; }
}
What I have tried:
All i found on the internet depence on FirstOrDefault. But I don't use this