Example #1
0
 public object Get(DocumentCreate request)
 {
     return new HttpResult(request)
     {
         View = "Create"
     };
 }
Example #2
0
        public object Post(DocumentCreate request)
        {
            var document = new Document()
            {
                Title = "New " + Convert.ToString(request.DocumentType),
                DocumentType = request.DocumentType,
                Created = DateTime.Now,
                Updated = DateTime.Now
            };

            Db.Save(document);

            return new HttpResult(document)
            {
                Location = "/documents/" + document.Id
            };
        }