public IActionResult OnPostAsync(RazorPageModel model) { if (!ModelState.IsValid) { return(Page()); } Iban iban = Iban.Parse(model.BankAccountNumber); // Do something with model... BankAccountNumber = iban.ToString(Iban.Formats.Partitioned); return(Page()); }
public IActionResult Save(InputModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Iban iban = Iban.Parse(model.BankAccountNumber); // Do something with model... model.BankAccountNumber = iban.ToString(Iban.Formats.Partitioned); return(Json(model)); }
public IActionResult Save(InputModel model) { if (!ModelState.IsValid) { return(View("Index")); } Iban iban = Iban.Parse(model.BankAccountNumber); // Do something with model... ModelState.Clear(); model.BankAccountNumber = iban.ToString(Iban.Formats.Partitioned); return(View("Index", model)); }
public override void SetUp() { base.SetUp(); _iban = Iban.Parse(TestValues.ValidIban); }