コード例 #1
0
 public ActionResult CreateNyhet([Bind(Include = "Ämne,Innehåll")] NyhetModel model)
 {
     if (ModelState.IsValid)
     {
         db.Add(model);
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
コード例 #2
0
ファイル: Databas.cs プロジェクト: matrix543/garage-project
 public void Add(NyhetModel nyhet)
 {
     Nyheter.Add(nyhet);
     this.SaveChanges();
 }