Пример #1
0
        public void DeleteChildInstance()
        {
            EAV.Store.Clients.IInstanceStoreClient client = factory.Create <EAV.Store.Clients.IInstanceStoreClient>();
            EAVStoreClient.Instance  dbParentInstance     = SelectRandomItem(this.DbContext.Instances);
            EAVStoreClient.Container dbContainer          = SelectRandomItem(this.DbContext.Containers);
            EAVStoreClient.Instance  dbInstanceIn         = CreateInstance(dbContainer.Container_ID, dbParentInstance.Subject_ID, dbParentInstance.Instance_ID);

            client.DeleteInstance(dbInstanceIn.Instance_ID);

            EAVStoreClient.Instance dbInstanceOut = this.DbContext.Instances.SingleOrDefault(it => it.Instance_ID == dbInstanceIn.Instance_ID);

            Assert.IsNull(dbInstanceOut, "Failed to delete instance ID {0} from the database.", dbInstanceIn.Instance_ID);
        }
Пример #2
0
        public IHttpActionResult DeleteInstance(int id)
        {
            try
            {
                instanceClient.DeleteInstance(id);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }