public static void HasResourceType(IKey key, ResourceType type) { if (key.TypeName != Hacky.GetResourceNameForResourceType(type)) { throw Error.BadRequest("Operation only valid for {0} resource type"); } }
public static CapabilityStatement AddSingleResourceComponent(this CapabilityStatement conformance, String resourcetype, Boolean readhistory, Boolean updatecreate, CapabilityStatement.ResourceVersionPolicy versioning, ResourceReference profile = null) { var resource = new CapabilityStatement.ResourceComponent(); resource.Type = Hacky.GetResourceTypeForResourceName(resourcetype); resource.Profile = profile; resource.ReadHistory = readhistory; resource.UpdateCreate = updatecreate; resource.Versioning = versioning; conformance.Server().Resource.Add(resource); return(conformance); }
public static Conformance AddSingleResourceComponent(this Conformance conformance, string resourcetype, bool readhistory, bool updatecreate, Conformance.ResourceVersionPolicy versioning, ResourceReference profile = null) { var resource = new Conformance.ResourceComponent(); resource.Type = Hacky.GetResourceTypeForResourceName(resourcetype); resource.Profile = profile; resource.ReadHistory = readhistory; resource.UpdateCreate = updatecreate; resource.Versioning = versioning; conformance.Server().Resource.Add(resource); return(conformance); }
public static CapabilityStatement AddSingleResourceComponent( this CapabilityStatement capabilityStatement, string resourcetype, bool readhistory, bool updatecreate, CapabilityStatement.ResourceVersionPolicy versioning, Canonical profile = null) { var resource = new CapabilityStatement.ResourceComponent { Type = Hacky.GetResourceTypeForResourceName(resourcetype), Profile = profile, ReadHistory = readhistory, UpdateCreate = updatecreate, Versioning = versioning }; capabilityStatement.Server().Resource.Add(resource); return(capabilityStatement); }