public ServerFhirResponse Update(string type, Resource resource, string id = null) { string versionid = FhirHttpUtil.IfMatchVersionId(HttpContext.Request); Key key = Key.Create(type, id, versionid); if (key.HasResourceId()) { return(fhirService.Update(key, resource)); } else { SearchParams searchparams = SearchParams.FromUriParamList(HttpHeaderUtil.TupledParameters(HttpContext.Request)); return(fhirService.ConditionalUpdate(key, resource, searchparams)); } }
public FhirResponse Update(string type, Resource resource, string id = null) { string versionid = Request.IfMatchVersionId(); Key key = Key.Create(type, id, versionid); if (key.HasResourceId()) { return(_fhirService.Update(key, resource)); } else { return(_fhirService.ConditionalUpdate(key, resource, SearchParams.FromUriParamList(Request.TupledParameters()))); } }
public ActionResult <FhirResponse> Update(string type, Resource resource, string id = null) { string versionId = Request.GetTypedHeaders().IfMatch?.FirstOrDefault()?.Tag.Buffer; Key key = Key.Create(type, id, versionId); if (key.HasResourceId()) { Request.TransferResourceIdIfRawBinary(resource, id); return(new ActionResult <FhirResponse>(_fhirService.Update(key, resource))); } else { return(new ActionResult <FhirResponse>(_fhirService.ConditionalUpdate(key, resource, SearchParams.FromUriParamList(Request.TupledParameters())))); } }