Exemple #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());
        }
        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));
        }
Exemple #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));
        }
Exemple #4
0
            public override void SetUp()
            {
                base.SetUp();

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