示例#1
0
 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)));
示例#2
0
 public ActionResult UpdateBankAccountType(long id, BankAccountTypeViewModel viewModel)
 => _bankAccountTypeCrudHandler
 .Update(id, viewModel.ToDto())
 .Match <ActionResult>(
     Left: err => BadRequest(err.Message),
     Right: c => Ok(FromEntity(c)));