public ActionResult Register(ProviderMV prov) { /*db.Provider.Add(prov.Provider); * db.SaveChanges();*/ return(View("Create")); if (ModelState.IsValid) { Provider provider = prov.Provider; provider.User = prov.User; db.Provider.Add(provider); db.SaveChanges(); return(RedirectToAction("SignIn", "User", new { UserOrEmail = prov.User.Username, Pass = prov.User.Pass })); } else { return(View("Create")); } }
public ActionResult Register(ProviderMV prov) { db.Provider.Add(prov.Provider); db.SaveChanges(); return(View("Create")); /* * return View("Create"); * if (ModelState.IsValid) * { * Provider provider = prov.Provider; * provider.User = prov.User; * db.Provider.Add(provider); * db.SaveChanges(); * return RedirectToAction("SignIn", "User", new {UserOrEmail = prov.User.Username, Pass = prov.User.Pass}); * } * else { * return View("Create"); * }*/ }