public async Task <IActionResult> Create([FromBody] CreateDebtRequest request) { if (!ModelState.IsValid) { return(BadRequest()); } await _debtService.Create(request); return(Ok()); }
public IActionResult Create([FromBody] CreateDebtDTO debt) { try { _debtService.Create(_user.Email, debt); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task <Debt> CreateDebt(Debt debt) { var result = await _service.Create(debt); return(result); }