public ActionResult GetDocument(string id) { IWikiDocumentAppService service = this.CreateService <IWikiDocumentAppService>(); WikiDocumentDetail doc = service.GetDocumentDetail(id); return(this.SuccessData(doc)); }
public ActionResult Document(string id) { DocumentModel doc = new DocumentModel(); if (id != null) { IWikiDocumentAppService service = this.CreateService <IWikiDocumentAppService>(); WikiDocumentDetail detail = service.GetDocumentDetail(id); if (detail == null) { /* 404 */ } doc.Id = detail.Id; doc.Title = detail.Title; doc.Tag = detail.Tag; doc.Summary = detail.Summary; doc.MarkdownCode = detail.MarkdownCode; } this.ViewBag.Doc = doc; return(View()); }
public string Add(AddDocumentInput input) { input.Validate(); WikiDocumentDetail detail = AceMapper.Map<WikiDocumentDetail>(input); detail.Id = IdHelper.CreateSnowflakeId().ToString(); detail.IsDeleted = false; detail.CreationTime = DateTime.Now; this.DbContext.Insert(detail); return detail.Id; }
public string Add(AddDocumentInput input) { input.Validate(); WikiDocumentDetail detail = new WikiDocumentDetail(); detail.Id = IdHelper.CreateSnowflakeId().ToString(); detail.Title = input.Title; detail.Summary = input.Summary; detail.Tag = input.Tag; detail.IsDeleted = false; detail.CreationTime = DateTime.Now; detail.HtmlContent = input.HtmlContent; detail.MarkdownCode = input.MarkdownCode; this.DbContext.Insert(detail); return(detail.Id); }
public ActionResult GetDocument(string id) { WikiDocumentDetail doc = this.Service.GetDocumentDetail(id); return(this.SuccessData(doc)); }