public static IsResourceIdEqual ( IKey key, Hl7.Fhir.Model.Resource resource ) : void | ||
key | IKey | |
resource | Hl7.Fhir.Model.Resource | |
Résultat | void |
public FhirResponse Put(IKey key, Resource resource) { Validate.Key(key); Validate.ResourceType(key, resource); Validate.HasTypeName(key); Validate.HasResourceId(key); Validate.HasResourceId(resource); Validate.IsResourceIdEqual(key, resource); Entry current = fhirStore.Get(key); Entry entry = Entry.PUT(key, resource); transfer.Internalize(entry); Store(entry); // API: The api demands a body. This is wrong //CCR: The documentations specifies that servers should honor the Http return preference header Entry result = fhirStore.Get(entry.Key); transfer.Externalize(result); return(Respond.WithResource(current != null ? HttpStatusCode.OK : HttpStatusCode.Created, result)); }
public FhirResponse Put(IKey key, Resource resource) { Validate.Key(key); Validate.ResourceType(key, resource); Validate.HasTypeName(key); Validate.HasResourceId(key); Validate.HasResourceId(resource); Validate.IsResourceIdEqual(key, resource); Interaction interaction = Interaction.PUT(key, resource); transfer.Internalize(interaction); Store(interaction); // API: The api demands a body. This is wrong Interaction result = store.Get(interaction.Key); transfer.Externalize(result); return(Respond.WithResource(HttpStatusCode.OK, interaction)); }