-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlayerRepository.cs
34 lines (29 loc) · 999 Bytes
/
PlayerRepository.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FrameworkConsoleApp
{
public class PlayerRepository
{
List<Player> _playerList = new List<Player>();
public PlayerRepository()
{
_playerList.Add(new Player(1, "Virat", "India"));
_playerList.Add(new Player(2, "Rohit", "India"));
_playerList.Add(new Player(3, "Steve", "Australia"));
_playerList.Add(new Player(4, "Pat", "Australia"));
_playerList.Add(new Player(5, "Ross", "New Zealand"));
_playerList.Add(new Player(6, "Trent", "New Zealand"));
}
public List<Player> GetAll()
{
return _playerList;
}
public List<Player> GetPlayersFromTeam(string team)
{
return _playerList.Where(x_ => string.Equals(x_.Team, team, StringComparison.InvariantCultureIgnoreCase)).ToList();
}
}
}