コード例 #1
0
        public IActionResult Post([FromBody] Debit debit)
        {
            _rep.Add(debit);
            if (_rep.SaveChanges())
            {
                return(Ok(debit));
            }

            return(BadRequest("Debit not found!"));
        }
コード例 #2
0
        public IActionResult Post(Category category)
        {
            _rep.Add(category);
            if (_rep.SaveChanges())
            {
                return(Ok(category));
            }

            return(BadRequest("Category not found!"));
        }
コード例 #3
0
        public IActionResult Post(PaymentMethod payment)
        {
            _rep.Add(payment);
            if (_rep.SaveChanges())
            {
                return(Ok(payment));
            }

            return(BadRequest("Payment Method not found!"));
        }