示例#1
0
        public ActionResult CodeValidation(CodeValidationViewModel viewModel)
        {
            if (viewModel.Property != 0)
            {
                this.ModelState.AddModelError(nameof(CodeValidationViewModel.Property), "Property has to be 0");
            }

            if (this.ModelState.IsValid)
            {
                return(this.RedirectToAction("Index", "Validation")
                       .WithSuccessAlert("Validation entity has been created"));
            }

            return(this.View(viewModel));
        }
示例#2
0
        public ActionResult CodeValidation()
        {
            var viewModel = new CodeValidationViewModel();

            return(this.View(viewModel));
        }