public ActionResult Create(DBBlogArticle article) { if (this.Authorizer.IsLogedIn(this.Session, this.Request) && this.ModelState.IsValid) { this.Authorizer.ReauthorizeLogin(this.Session); new DBBlogArticleRepository(this.DatabaseContext).Add(article, true); return(RedirectToAction("Index")); } return(RedirectToAction("Index", "Login")); }
public ActionResult Delete(int id) { if (this.Authorizer.IsLogedIn(this.Session, this.Request)) { this.Authorizer.ReauthorizeLogin(this.Session); DBBlogArticleRepository repository = new DBBlogArticleRepository(this.DatabaseContext); DBBlogArticle article = repository.Find(id); repository.Remove(article, true); return(RedirectToAction("Index")); } return(RedirectToAction("Index", "Login")); }