public FhirResponse Update(string type, string id, Resource resource) { string versionid = Request.IfMatchVersionId(); Key key = Key.Create(type, id, versionid); return(service.Update(key, resource)); }
public FhirResponse Update(string type, string id, Resource resource) { //string xml = FhirSerializer.SerializeResourceToXml(resource); // DSTU2: tags //entry.Tags = Request.GetFhirTags(); // todo: move to model binder? string versionid = Request.IfMatchVersionId(); Key key = Key.Create(type, id, versionid); return(service.Update(key, resource)); }
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)); } }