public ActionResult AddNew(string title, string description) { ArticleRepository repo = new ArticleRepository(); ArticleModel model = new ArticleModel(); model.CreatedBy = User.Identity.Name; DateTime now = DateTime.Now; model.CreatedDate = now; model.LastModifiedDate = now; model.Id = Guid.NewGuid(); model.Title = title; model.Description = description; repo.AddNewArticle(model); return Json(true, JsonRequestBehavior.AllowGet); }
public bool AddNewArticle(ArticleModel a) { save(a, a.Id.ToString()); return true; }