Created
March 20, 2011 08:18
-
-
Save karlseguin/878191 to your computer and use it in GitHub Desktop.
shitty msdn example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I goto: http://msdn.microsoft.com/en-us/data/gg685467 | |
//and this is one of the first thing I see...*horrible* | |
[HttpPost] | |
public ActionResult Create(Blog newBlog) | |
{ | |
try | |
{ | |
using (var db = new BlogContext()) | |
{ | |
db.Blogs.Add(newBlog); | |
db.SaveChanges(); | |
} | |
return RedirectToAction("Index"); | |
} | |
catch | |
{ | |
return View(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment