예제 #1
0
        public async Task <IActionResult> Create([FromBody] CreateDebtRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            await _debtService.Create(request);

            return(Ok());
        }
예제 #2
0
        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);
        }