TournamentForm . populated teams list
This commit is contained in:
@ -99,5 +99,22 @@ namespace TrackerLibrary.DataAccess
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
public List<TeamModel> GetTeam_All()
|
||||
{
|
||||
List<TeamModel> output;
|
||||
using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(GlobalConfig.CnnString(db)))
|
||||
{
|
||||
output = connection.Query<TeamModel>("dbo.spTeam_GetAll").ToList();
|
||||
|
||||
foreach(TeamModel team in output)
|
||||
{
|
||||
var p = new DynamicParameters();
|
||||
p.Add("@TeamId", team.Id);
|
||||
team.TeamMembers = connection.Query<PersonModel>("dbo.spTeamMembers_GetByTeam",p, commandType: CommandType.StoredProcedure).ToList();
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user