public List <string> GetAllScoreJsonList() { try { return(AppGlobal.ConvertListToJson(_context.Repository <Score>().GetAll().ToList())); } catch (Exception e) { throw; } }
public List <string> GetMatchRoster() { List <string> result = new List <string>(); List <Player> matchRoster = new List <Player>(); List <Player> players = _context.Repository <Player>().GetAll().Where(x => x.PlayerIsComing == true).ToList(); if (players.Where(x => x.PlayerPosition == "Forward").Count() == 2) { if (players.Where(x => x.PlayerPosition == "MidField").Count() + players.Where(x => x.PlayerPosition == "Deffence").Count() == 10) { if (players.Where(x => x.PlayerPosition == "GoalKeeper").Count() == 2) { matchRoster.AddRange(players.Where(x => x.PlayerPosition == "GoalKeeper").ToList()); } else { matchRoster.AddRange(players.Where(x => x.PlayerPosition == "GoalKeeper").ToList()); result.Add("Kaleciniz bulunmamaktadır. "); } matchRoster.AddRange(players.Where(x => x.PlayerPosition == "MidField").ToList()); matchRoster.AddRange(players.Where(x => x.PlayerPosition == "Deffence").ToList()); } else { result.Add("Orta Saha ve Defans : Yeterli sayıda oyuncu yok. "); } matchRoster.AddRange(players.Where(x => x.PlayerPosition == "Forward").ToList()); } else { result.Add("Forvetiniz bulunmamaktadır."); } List <string> matchPlayerRoster = AppGlobal.ConvertListToJson(matchRoster); if (matchPlayerRoster.Count == 14) { return(matchPlayerRoster); } else { return(result); } }
public List <string> GetScoreJsonList() { return(AppGlobal.ConvertListToJson(Service.GetAllScore().ToList())); }