Exemplo n.º 1
0
 public bool Update(PlayerModel item)
 {
     if (items.Any(x => x.Id == item.Id))
     {
         items[item.Id] = item;
         return true;
     }
     return false;
 }
Exemplo n.º 2
0
 public PlayerTestRepository(IBuildRepository builds)
 {
     var player = new PlayerModel { Name = "Jupotter" };
     player.Build.Add(builds.GetById(0));
     player.Build.Add(builds.GetById(1));
     Add(player);
     player = new PlayerModel { Name = "Nilun" };
     player.Build.Add(builds.GetById(2));
     player.Build.Add(builds.GetById(3));
     player.Build.Add(builds.GetById(1));
     Add(player);
     player = new PlayerModel { Name = "Smurfi" };
     player.Build.Add(builds.GetById(4));
     Add(player);
 }
Exemplo n.º 3
0
 public void Add(PlayerModel item)
 {
     item.Id = 1 + items.Max(x => (int?)x.Id) ?? 0;
     items.Add(item);
 }