Beispiel #1
0
        public ActionResult GetTaxRegimeTypes()
        {
            var result = _taxRegimeTypeOperation.GetAll()
                         .Select(tr => TaxRegimeTypeViewModel.FromDto(tr));

            if (result.Any())
            {
                return(Ok(result));
            }

            return(NotFound());
        }
Beispiel #2
0
 public ActionResult UpdateTaxRegimeType(long id, TaxRegimeTypeViewModel viewModel)
 => _taxRegimeTypeOperation
 .Update(id, viewModel.ToDto())
 .Match <ActionResult>(
     Left: err => BadRequest(err.Message),
     Right: tr => Ok(TaxRegimeTypeViewModel.FromDto(tr)));
Beispiel #3
0
 public IActionResult GetTaxRegimeType(long id)
 => _taxRegimeTypeOperation
 .Find(id)
 .Match <ActionResult>(
     Left: err => NotFound(err.Message),
     Right: t => Ok(TaxRegimeTypeViewModel.FromDto(t)));
Beispiel #4
0
 public ActionResult CreateTaxRegimeType(TaxRegimeTypeViewModel viewModel)
 => _taxRegimeTypeOperation
 .Create(viewModel.ToDto())
 .Match <ActionResult>(
     Left: err => BadRequest(err.Message),
     Right: t => Ok(TaxRegimeTypeViewModel.FromDto(t)));