// GET: Home public ActionResult AddUrl(string URL) { var shortURL = Helper.RandomString(5); //Generate random 5 char string //add properties to database. db.Urls.Add(new Url { ShortURL = shortURL, LongURL = URL, Created = DateTime.Now, }); db.SaveChanges(); return(View("Index")); }
public void Save() { _db.SaveChanges(); }