public async Task StoreRetrait(CreateRetrait retrait) { try { await _stockApi.CreateRetrait(retrait); } catch (ApiException e) { throw new StockApiException(e.Message); } catch (Exception e) { Console.WriteLine(e); throw; } }
public async Task <ActionResult> CreateRetrait([Bind()] CreateRetrait payload) { try { if (!ModelState.IsValid) { return(NotFound()); } await _activiteService.StoreRetrait(payload); return(RedirectToAction(nameof(Retraits))); } catch (Exception e) { _logger.LogError(e.Message); throw; } }