public ActionResult Create(NewWebsiteModel website) { website.LoginID = User.Identity.GetUserId(); IDBConnector db = DBConnectorFactory.GetDBConnector(); db.InsertWebsite(website); return(RedirectToAction("MyWebsites")); }
public void InsertWebsite(NewWebsiteModel website) { List <NewWebsiteModel> websites = new List <NewWebsiteModel>() { website }; using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(connectionString)) { connection.Execute("WebsiteData.spWebsite_Insert @Title, @LoginID, @VisibilityID, @Description", websites); } }