コード例 #1
0
ファイル: ArticleController.cs プロジェクト: fathurxzz/aleqx
 public ActionResult Create(FormCollection form)
 {
     try
     {
         using (var context = new CatalogueContainer())
         {
             var article = new Article();
             TryUpdateModel(article, new[] { "Title", "Date" });
             article.Text = HttpUtility.HtmlDecode(form["Text"]);
             context.AddToArticle(article);
             context.SaveChanges();
             return RedirectToAction("Index", "Articles", new { area = "" });
         }
     }
     catch
     {
         return View();
     }
 }
コード例 #2
0
ファイル: Catalogue.Designer.cs プロジェクト: fathurxzz/aleqx
 /// <summary>
 /// Create a new Article object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="date">Initial value of the Date property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="text">Initial value of the Text property.</param>
 public static Article CreateArticle(global::System.Int32 id, global::System.DateTime date, global::System.String title, global::System.String text)
 {
     Article article = new Article();
     article.Id = id;
     article.Date = date;
     article.Title = title;
     article.Text = text;
     return article;
 }
コード例 #3
0
ファイル: Catalogue.Designer.cs プロジェクト: fathurxzz/aleqx
 /// <summary>
 /// Deprecated Method for adding a new object to the Article EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToArticle(Article article)
 {
     base.AddObject("Article", article);
 }