public async Task <IActionResult> AddSportAsync(SportContractModel model) { try { return(await sportRepo.AddSportAsync(model)); } catch (Exception) { // Log?? return(BadRequest()); } }
private async void OnSave() { UpdateSport(Sport, _editingSport); if (EditMode) { await _repo.UpdateSportAsync(_editingSport); } else { await _repo.AddSportAsync(_editingSport); } Done(); }