public ActionResult Login(mvcregisValid mr) { //valids all the properties in the modelclass if (ModelState.IsValid) { //creation of mapper:from ui to login model var config1 = new MapperConfiguration(cfg => { cfg.CreateMap <mvcregisValid, modelreg>(); }); IMapper mapper1 = config1.CreateMapper(); var dest = mapper1.Map <mvcregisValid, modelreg>(mr); var t = b.verifyDbUser(dest); if (t) { return(RedirectToAction("Home")); } //else { // return View(); //} } return(View("Registration")); }