public ActionResult CreateBankAccountType(BankAccountTypeViewModel viewModel) => _bankAccountTypeCrudHandler .Create(viewModel.ToDto()) .Match <ActionResult>( Left: err => BadRequest(err.Message), Right: bt => CreatedAtRoute(nameof(GetBankAccountType), new { id = bt.Id }, FromEntity(bt)));
public ActionResult UpdateBankAccountType(long id, BankAccountTypeViewModel viewModel) => _bankAccountTypeCrudHandler .Update(id, viewModel.ToDto()) .Match <ActionResult>( Left: err => BadRequest(err.Message), Right: c => Ok(FromEntity(c)));