After i finished my SimpleMembership Step on my Application, there is another problem...
namespace Korbball.Models
{
public class GamesContext : DbContext
{
public GamesContext()
: base("KorbballDBContext")
{
}
public DbSet<Games> Games { get; set; }
public DbSet<Teams> Teams { get; set; }
}
public class Games
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int GameId { get; set; }
public int TeamA { get; set; }
public int TeamB { get; set; }
public int ResultA { get; set; }
public int ResultB { get; set; }
public int League { get; set; }
public DateTime StartDate { get; set; }
public Boolean Finished { get; set; }
}
public class Teams
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int TeamId { get; set; }
public string TeamName { get; set; }
}
}
My target is, to create Games with Results etc. The TeamA & TeamB column shoukd be the TeamID from the Teams Table.
Whats steps i have to do to set the correct relationship.
Additional Informations:
Games Table ->
GamesID = 1
TeamA = 1
TeamB = 2
ResultA = 10
ResultB = 8
Teams Table ->
TeamId = 1
TeamName = "Manchester"
TeamId = 2
TeamName = "Zurich"
On the view ->
Manchester 10 : 8 Zurich