using System.Collections.Generic;
public static void Main()
Team carolinaPanthers = new Team();
carolinaPanthers.Location = "Charlotte, NC";
carolinaPanthers.Name = "Carolina Panthers";
Team atlFal = new Team();
atlFal.Location = "Atlanta, GA";
atlFal.Name = "Atlanta Falcons";
Team noSnts = new Team();
noSnts.Location = "New Orleans, LA";
noSnts.Name = "New Orleans Saints";
Table teamTable = new Table();
teamTable.AddTeam(carolinaPanthers);
teamTable.AddTeam(atlFal);
teamTable.AddTeam(noSnts);
for(int i = 1; i <= teamTable.QueryTeams().Count; i++)
Console.WriteLine(teamTable.GetTeam(i).Name + ": " + teamTable.GetTeam(i).Location);
Player player1 = new Player();
interface ITeamRepository {
class TeamRepository : ITeamRepository {
public TeamRepository(Table table) {
private readonly List<Team> _teams;
this._teams = new List<Team>();
public void AddTeam(Team team)
team.Id = ++this._nextTeamId;
public List<Team> QueryTeams() {
public Team GetTeam(int Id){
return _teams.Find(t => t.Id == Id);
private string name, location;
get { return this.name; }
set { this.name = value; }
get { return this.location; }
set { this.location = value; }
public void AddPlayers(Player players)
List<string> playerName = new List<string>();
playerName.Add(players.FirstName);
playerName.Add(players.LastName);
List<int> playerAge = new List<int>();
playerAge.Add(players.Age);
private string firstName, lastName;
get { return this.firstName; }
set { this.firstName = value; }
get { return this.lastName; }
set { this.lastName = value; }
set { this.age = value; }