Skip to content

Instantly share code, notes, and snippets.

@karlseguin
Created March 20, 2011 08:18
Show Gist options
  • Save karlseguin/878191 to your computer and use it in GitHub Desktop.
Save karlseguin/878191 to your computer and use it in GitHub Desktop.
shitty msdn example
// 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