public int AddMacth([FromBody] Match match)
 {
     try
     {
         MatchLogic matchLogic = new MatchLogic();
         matchLogic.AddMatch(match);
     }
     catch (Exception)
     {
         return match.FirstTeamId;
     }
     return match.Id;
 }
 public int CalculateFirstTeamScore(int id)
 {
     object locker = new object();
     MatchLogic matchLogic = new MatchLogic();
     int firstTeamId = matchLogic.GetMatchById(id).FirstTeamId;
     int secondTeamId = matchLogic.GetMatchById(id).SecondTeamId;
     int minute = matchLogic.GetCurrentMinute(id);
     lock (locker)
     {
         matchLogic.CalculateMinute(firstTeamId, secondTeamId, id, minute);
         matchLogic.UpdateTimer(id);
     }
     return matchLogic.GetMatchById(id).FirstTeamGoals;
 }
 public int GetFirstTeamScore(int id)
 {
     MatchLogic matchLogic = new MatchLogic();
     return matchLogic.GetMatchById(id).FirstTeamGoals;
 }
 public int GetFirstTeamId(int id)
 {
     MatchLogic matchLogic = new MatchLogic();
     return matchLogic.GetMatchById(id).FirstTeamId;
 }
 public int GetCurrentMinute(int id)
 {
     MatchLogic matchLogic = new MatchLogic();
     return matchLogic.GetCurrentMinute(id);
 }
 public int CalculateSecondTeamScore(int id)
 {
     MatchLogic matchLogic = new MatchLogic();
     return matchLogic.GetMatchById(id).SecondTeamGoals;
 }
 public IEnumerable<Match> GetTeamMatches()
 {
     MatchLogic matchLogic = new MatchLogic();
     UserLogic userLogic = new UserLogic();
     int id = userLogic.GetIdByNameUser(User.Identity.Name);
     return matchLogic.GetMatchesByUser(id);
 }
 public int GetSecondTeamId(int id)
 {
     MatchLogic matchLogic = new MatchLogic();
     return matchLogic.GetMatchById(id).SecondTeamId;
 }