Esempio n. 1
0
 public ActionResult Write(Twitter twitter)
 {
     TryUpdateModel(twitter, new string[] { "Content" });
     if (ModelState.IsValid)
     {
         twitter.PublishDate = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
         twitter.Author      = "常伟华";
         repository.Add(twitter);
     }
     return(View("Index"));
 }