コード例 #1
0
ファイル: FhirService.cs プロジェクト: HowardEdidin/spark
        private ResourceEntry internalVRead(string collection, string id, string vid)
        {
            RequestValidator.ValidateCollectionName(collection);
            RequestValidator.ValidateId(id);
            RequestValidator.ValidateVersionId(vid);

            var versionUri = ResourceIdentity.Build(collection, id, vid);

            BundleEntry entry = _store.FindVersionByVersionId(versionUri);

            if (entry == null)
            {
                throwNotFound("Cannot read version of resource", collection, id, vid);
            }
            else if (entry is DeletedEntry)
            {
                throw new SparkException(HttpStatusCode.Gone,
                                         "A {0} resource with version {1} and id {2} exists, but is a deletion (deleted on {3}).",
                                         collection, vid, id, (entry as DeletedEntry).When);
            }

            return((ResourceEntry)entry);
        }