示例#1
0
        private static void CancelRequestTest(DataServiceContextWrapper <DefaultContainer> contextWrapper)
        {
            contextWrapper.Configurations.RequestPipeline
            .OnEntryStarting(PipelineEventsTestsHelper.ModifyPropertyValueCustomerEntity_Writing)
            .OnEntryEnding(PipelineEventsTestsHelper.ModifyPropertyValueCustomerEntry_Writing);

            Customer customer = PipelineEventsTestsHelper.CreateNewCustomer();

            contextWrapper.AddObject("Customer", customer);

            IAsyncResult result = contextWrapper.BeginSaveChanges(null, null);

            contextWrapper.CancelRequest(result);

            Assert.IsTrue(customer.Name.EndsWith("ModifyPropertyValueCustomerEntity_Writing"), "Unexpected primitive property");
        }
        private static void CancelRequestTest(DataServiceContextWrapper<DefaultContainer> contextWrapper)
        {
            contextWrapper.Configurations.RequestPipeline
                .OnEntryStarting(PipelineEventsTestsHelper.ModifyPropertyValueCustomerEntity_Writing)
                .OnEntryEnding(PipelineEventsTestsHelper.ModifyPropertyValueCustomerEntry_Writing);

            Customer customer = PipelineEventsTestsHelper.CreateNewCustomer();
            contextWrapper.AddObject("Customer", customer);

            IAsyncResult result = contextWrapper.BeginSaveChanges(null, null);
            contextWrapper.CancelRequest(result);

            Assert.IsTrue(customer.Name.EndsWith("ModifyPropertyValueCustomerEntity_Writing"), "Unexpected primitive property");
        }