public ActionResult Create(UserArticle model) { var article = new UserArticle { Name =Utils.Transliterator.Transliterate( model.Name), Title = model.Title, Text = HttpUtility.HtmlDecode(model.Text) }; _context.AddToUserArticle(article); _context.SaveChanges(); return RedirectToAction("Index"); }
/// <summary> /// Deprecated Method for adding a new object to the UserArticle EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToUserArticle(UserArticle userArticle) { base.AddObject("UserArticle", userArticle); }
/// <summary> /// Create a new UserArticle object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="title">Initial value of the Title property.</param> public static UserArticle CreateUserArticle(global::System.Int32 id, global::System.String name, global::System.String title) { UserArticle userArticle = new UserArticle(); userArticle.Id = id; userArticle.Name = name; userArticle.Title = title; return userArticle; }