Ejemplo n.º 1
0
 public object Get(DocumentCreate request)
 {
     return new HttpResult(request)
     {
         View = "Create"
     };
 }
Ejemplo n.º 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
            };
        }