示例#1
0
        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());
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
            public override void SetUp()
            {
                base.SetUp();

                _iban = Iban.Parse(TestValues.ValidIban);
            }