예제 #1
0
        public async Task <IActionResult> Post([FromForm] DocumentInput upload)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var result = await _documentRepository.Create(upload);

            return(Ok(result));
        }
예제 #2
0
        public HttpResponseMessage Create([ModelBinder] Session session)
        {
            var document = documentsRepository.Create(session.UserId);

            return(new RedirectResult($"/Editor/{document.Id}"));
        }