예제 #1
0
        public HttpResponseMessage Upsert(string type, string id, ResourceEntry entry)
        {
            entry.Tags = Request.GetFhirTags(); // todo: move to model binder?

            if (service.Exists(type, id))
            {
                ResourceEntry newEntry = service.Update(entry, type, id);
                return(Request.StatusResponse(newEntry, HttpStatusCode.OK));
            }
            else
            {
                ResourceEntry newEntry = service.Create(entry, type, id);
                return(Request.StatusResponse(newEntry, HttpStatusCode.Created));
            }
        }