public IHttpActionResult PostDocument(Document document) { if (!ModelState.IsValid) { return BadRequest(ModelState); } document.ID = _documents.Count; _documents.Add(document); return Created(document); }
public Document(Document d) { ID = d.ID; Name = d.Name; Content = d.Content; }