コード例 #1
0
ファイル: NoteController.cs プロジェクト: fathurxzz/aleqx
        public ActionResult Create(FormCollection form)
        {
            try
            {
                using (var context = new LibraryContainer())
                {
                    var note = new Note();
                    TryUpdateModel(note, new[] { "Title", "Date" });
                    note.Text = HttpUtility.HtmlDecode(form["Text"]);
                    context.AddToNote(note);
                    context.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }