public Article Add(Article article) { Entities.Articles.AddObject(article); SaveChanges(); return article; }
// // GET: /Admin/Articles/Create public ActionResult Create() { Article article = new Article(); return View(new CreateArticlesViewModel { ArticleForm = new ArticleFormViewModel(){ AuthorName = User.Identity.FirstName + " " + User.Identity.LastName } }); }
public void Update(Article article) { SaveChanges(); }
public void Delete(Article article) { Entities.Articles.DeleteObject(article); SaveChanges(); }
/// <summary> /// Create a new Article object. /// </summary> /// <param name="articleId">Initial value of the ArticleId property.</param> /// <param name="title">Initial value of the Title property.</param> /// <param name="creationDate">Initial value of the CreationDate property.</param> /// <param name="text">Initial value of the Text property.</param> /// <param name="authorId">Initial value of the AuthorId property.</param> public static Article CreateArticle(global::System.Int32 articleId, global::System.String title, global::System.DateTime creationDate, global::System.String text, global::System.Int32 authorId) { Article article = new Article(); article.ArticleId = articleId; article.Title = title; article.CreationDate = creationDate; article.Text = text; article.AuthorId = authorId; return article; }
/// <summary> /// Deprecated Method for adding a new object to the Articles EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToArticles(Article article) { base.AddObject("Articles", article); }