Beispiel #1
0
        public HttpResponseMessage Patch([FromBody] PersonPatch personPatch)
        {
            var person = personRepository.Patch(personPatch);
            HttpResponseMessage httpResponseMessage = Request.CreateResponse(HttpStatusCode.Created, person);

            httpResponseMessage.Headers.Location = new Uri($"{Request.RequestUri}/{person.Id}");
            return(httpResponseMessage);
        }
        public Person Patch(PersonPatch patch)
        {
            var filter = Builders <Person> .Filter.Eq(u => u.Id, patch.Id);

            var result = _mongoCollection.Find(filter).SingleOrDefault();

            _mongoCollection.InsertOne(result);
            return(result);
        }
        public Person Patch(PersonPatch personPatch)
        {
            var person = GetById(personPatch.Id);

            return(person);
        }