public async Task <ActionResult> CurrentMatch(int?teamId) { int TeamId; if (teamId == null) { var user = this.User.FindFirst(x => x.Type == "UserId")?.Value; TeamId = Convert.ToInt32((await _teamPlayerService.Get(x => x.PlayerId == user)).Values?.Select(x => x.Id)); return(new JsonResult(TeamId > 0 ? await _service.CurrentMatch(TeamId) : "No Match Found")); } return(new JsonResult(await _service.CurrentMatch(Convert.ToInt32(teamId)))); }