public IActionResult GetFixtureAlgorithms() { IActionResult result; try { SetSession(); result = TryGetAlgorithms(); } catch (ServiceException e) { result = errors.GenerateError(e); } return(result); }
public IActionResult GetAll([FromQuery] DateTime from, [FromQuery] DateTime to) { IActionResult result; try { SetSession(); result = TryGet(from, to); } catch (ServiceException e) { result = errors.GenerateError(e); } return(result); }
private IActionResult CreateValidSport(SportModelIn modelIn) { IActionResult result; try { SetSession(); result = TryAddSport(modelIn); } catch (ServiceException e) { result = errors.GenerateError(e); } return(result); }
private IActionResult TryPostMatch(int id, ICollection <int> teamIds, string sportName, DateTime date) { IActionResult result; try { SetSession(); EncounterDto added = encounterService.AddEncounter(id, teamIds, sportName, date); EncounterModelOut output = factory.CreateModelOut(added); result = CreatedAtRoute("GetMatchById", new { matchId = added.id }, output); } catch (ServiceException e) { result = errors.GenerateError(e); } return(result); }