示例#1
0
        public FhirResponse ConditionalDelete(IKey key, SearchParams _params)
        {
            ISearchService      searchStore        = this.FindExtension <ISearchService>();
            ITransactionService transactionService = this.FindExtension <ITransactionService>();

            if (searchStore == null || transactionService == null)
            {
                throw new NotSupportedException("Operation not supported");
            }

            return(transactionService.HandleTransaction(ResourceManipulationOperationFactory.CreateDelete(key, searchStore, _params),
                                                        this) ?? Respond.WithCode(HttpStatusCode.NotFound));
        }
示例#2
0
        public FhirResponse ConditionalUpdate(IKey key, Resource resource, SearchParams _params)
        {
            //if update receives a key with no version how do we handle concurrency?
            ISearchService      searchStore        = this.FindExtension <ISearchService>();
            ITransactionService transactionService = this.FindExtension <ITransactionService>();

            if (searchStore == null || transactionService == null)
            {
                throw new NotSupportedException("Operation not supported");
            }
            return(transactionService.HandleTransaction(
                       ResourceManipulationOperationFactory.CreatePut(resource, key, searchStore, _params),
                       this));
        }
示例#3
0
        public FhirResponse ConditionalCreate(IKey key, Resource resource, SearchParams parameters)
        {
            ISearchService      searchStore        = this.FindExtension <ISearchService>();
            ITransactionService transactionService = this.FindExtension <ITransactionService>();

            if (searchStore == null || transactionService == null)
            {
                throw new NotSupportedException("Operation not supported");
            }

            return(transactionService.HandleTransaction(
                       ResourceManipulationOperationFactory.CreatePost(resource, key, searchStore, parameters),
                       this));
        }