Beispiel #1
0
        public IActionResult Update(int id, FeeVM feeVM)
        {
            if (id != feeVM.Id)
            {
                return(BadRequest());
            }
            var result = _feeSer.Update(id, feeVM);

            if (!result)
            {
                return(NotFound());
            }
            return(NoContent());
        }
Beispiel #2
0
        public ActionResult <FeeVM> Create(FeeVM feeVM)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var result = _feeSer.Add(feeVM);

            if (result == null)
            {
                return(Problem("Can't add new fee"));
            }
            return(CreatedAtAction(nameof(Get), new { id = result.Id }, result));
        }