Esempio n. 1
0
        public Task<ResourceResponse<Document>> UpdatePersonAsync(Person person)
        {
            var doc = Client.CreateDocumentQuery<Document>(Collection.DocumentsLink)
                .Where(d => d.Id == person.Id)
                .AsEnumerable() // why the heck do we need to do this??
                .FirstOrDefault();

            return Client.ReplaceDocumentAsync(doc.SelfLink, person);
        }
Esempio n. 2
0
 //api/people
 public async Task<IHttpActionResult> Put(Person person)
 {
     var response = await _repo.UpdatePersonAsync(person);
     return Ok(response.Resource);
 }
Esempio n. 3
0
 //api/people
 public async Task<IHttpActionResult> Post(Person person)
 {
     var response = await _repo.CreatePerson(person);
     return Ok(response.Resource);
 }
Esempio n. 4
0
 public Task<ResourceResponse<Document>> CreatePerson(Person person)
 {
     return Client.CreateDocumentAsync(Collection.DocumentsLink, person);
 }