當前位置: 首頁>>代碼示例>>C#>>正文


C# ChangeTrackingService.GetEntityState方法代碼示例

本文整理匯總了C#中Topics.Radical.ChangeTracking.ChangeTrackingService.GetEntityState方法的典型用法代碼示例。如果您正苦於以下問題:C# ChangeTrackingService.GetEntityState方法的具體用法?C# ChangeTrackingService.GetEntityState怎麽用?C# ChangeTrackingService.GetEntityState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Topics.Radical.ChangeTracking.ChangeTrackingService的用法示例。


在下文中一共展示了ChangeTrackingService.GetEntityState方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: after_add_GetEntityState_is_Changed

        public void after_add_GetEntityState_is_Changed()
        {
            EntityTrackingStates expected = EntityTrackingStates.HasBackwardChanges;

            ChangeTrackingService svc = new ChangeTrackingService();

            PersonCollection p = new PersonCollection( svc );
            p.Add( new Person( svc, false ) );
            p.Add( new Person( svc, false ) );

            EntityTrackingStates actual = svc.GetEntityState( p );

            actual.Should().Be.EqualTo( expected );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:14,代碼來源:CollectionChangeTrackingServiceTests.cs

示例2: changeTrackingService_using_atomicOperation_after_operation_complete_entityState_should_be_changed

		public void changeTrackingService_using_atomicOperation_after_operation_complete_entityState_should_be_changed()
		{
			var target = new ChangeTrackingService();

			var person = new Person( target );

			target.AcceptChanges();
			
			using( var op = target.BeginAtomicOperation() )
			{
				person.Name = "Mauro";

				op.Complete();
			}

			var state = target.GetEntityState( person );

			var actual = (state & EntityTrackingStates.HasBackwardChanges ) == EntityTrackingStates.HasBackwardChanges;
			actual.Should().Be.True();
		}
開發者ID:nazarenomanco,項目名稱:Radical,代碼行數:20,代碼來源:AtomicChangesChangeTrackingServiceTests.cs

示例3: service_on_stopTracking_removes_every_reference_to_entity

        public void service_on_stopTracking_removes_every_reference_to_entity()
        {
            EntityTrackingStates expected = EntityTrackingStates.None;

            ChangeTrackingService svc = new ChangeTrackingService();

            Person p = new Person( svc );
            p.Name = "Foo";

            svc.Detach( p );
            EntityTrackingStates actual = svc.GetEntityState( p );

            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:14,代碼來源:EntityChangeTrackingServiceTests.cs

示例4: changeTrackingService_getEntityState_using_entity_managed_by_different_service_should_return_None

        public void changeTrackingService_getEntityState_using_entity_managed_by_different_service_should_return_None()
        {
            var expected = EntityTrackingStates.None;

            ChangeTrackingService svc = new ChangeTrackingService();

            Person p = new Person( new ChangeTrackingService(), true );
            var actual = svc.GetEntityState( p );

            actual.Should().Be.EqualTo( expected );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:11,代碼來源:EntityChangeTrackingServiceTests.cs

示例5: using

		public void entityMemento_ctor_requesting_transient_registration_using_base_iMemento_to_suspended_memento_do_not_register_entity_as_transient()
		{
			EntityTrackingStates expected = EntityTrackingStates.None;
			using( var svc = new ChangeTrackingService() )
			{
				svc.Suspend();

				var target = this.CreateMock( true );
				( ( IMemento )target ).Memento = svc;

				EntityTrackingStates actual = svc.GetEntityState( target );

				actual.Should().Be.EqualTo( expected );
			}
		}
開發者ID:nazarenomanco,項目名稱:Radical,代碼行數:15,代碼來源:EntityMementoTests.cs

示例6: changeTrackingService_using_beginAtomicOperation_getEntityState_should_return_valid_entity_state

		public void changeTrackingService_using_beginAtomicOperation_getEntityState_should_return_valid_entity_state()
		{
			var target = new ChangeTrackingService();

			var person = new Person( target );
			var list = new PersonCollection( target );

			using( var op = target.BeginAtomicOperation() )
			{
				person.Name = "Mauro";
				list.Add( person );
				person.Name = "Mauro Servienti";

				op.Complete();
			}

			var actual = target.GetEntityState( person );
			actual.Should().Be.EqualTo( EntityTrackingStates.HasBackwardChanges | EntityTrackingStates.IsTransient | EntityTrackingStates.AutoRemove );
		}
開發者ID:nazarenomanco,項目名稱:Radical,代碼行數:19,代碼來源:AtomicChangesChangeTrackingServiceTests.cs

示例7: if_entity_is_iComponent_on_Disposed_entity_is_removed_from_transient

        public void if_entity_is_iComponent_on_Disposed_entity_is_removed_from_transient()
        {
            ChangeTrackingService svc = new ChangeTrackingService();
            EntityTrackingStates expected = EntityTrackingStates.None;

            Person p = null;
            using( p = new Person( svc, false ) )
            {
                svc.RegisterTransient( p, false );
            }

            EntityTrackingStates actual = svc.GetEntityState( p );

            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:15,代碼來源:EntityChangeTrackingServiceTests.cs

示例8: entity_registeredAsTransient_with_autoRemove_on_Undo_is_transient

        public void entity_registeredAsTransient_with_autoRemove_on_Undo_is_transient()
        {
            ChangeTrackingService svc = new ChangeTrackingService();
            EntityTrackingStates expected = EntityTrackingStates.IsTransient | EntityTrackingStates.AutoRemove;

            Person p = new Person( svc );
            svc.Undo();

            EntityTrackingStates actual = svc.GetEntityState( p );

            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:12,代碼來源:EntityChangeTrackingServiceTests.cs

示例9: ChangeTrackingService

        public void changeTrackingService_revert_normal_entity_registered_transient_with_no_autoRemove_and_changes_before_bookmark_creation_should_remain_transient()
        {
            var expected = EntityTrackingStates.IsTransient | EntityTrackingStates.HasBackwardChanges;

            var memento = new ChangeTrackingService();
            var person = new Person( memento, false );
            memento.RegisterTransient( person, false );
            person.Name = "Mauro";

            var bookmark = memento.CreateBookmark();

            new Person( memento, true );
            memento.Revert( bookmark );

            var actual = memento.GetEntityState( person );

            actual.Should().Be.EqualTo( expected );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:18,代碼來源:EntityChangeTrackingServiceTests.cs

示例10: tansientEntity_afterPropertyChanges_GetEntityState_IsTransient_AutoRemove_HasBackwardChanges

        public void tansientEntity_afterPropertyChanges_GetEntityState_IsTransient_AutoRemove_HasBackwardChanges()
        {
            EntityTrackingStates expected = EntityTrackingStates.IsTransient | EntityTrackingStates.AutoRemove | EntityTrackingStates.HasBackwardChanges;

            ChangeTrackingService svc = new ChangeTrackingService();

            Person p = new Person( svc );
            p.Name = "Mauro";

            EntityTrackingStates actual = svc.GetEntityState( p );

            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:13,代碼來源:EntityChangeTrackingServiceTests.cs

示例11: afterPropertyChanges_GetEntityState_is_Changed

        public void afterPropertyChanges_GetEntityState_is_Changed()
        {
            EntityTrackingStates expected = EntityTrackingStates.HasBackwardChanges;

            ChangeTrackingService svc = new ChangeTrackingService();

            Person p = new Person( svc, false );
            p.Name = "Mauro";

            EntityTrackingStates actual = svc.GetEntityState( p );

            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:13,代碼來源:EntityChangeTrackingServiceTests.cs

示例12: after_mutual_exclusive_actions_entity_state_is_HasBackwardChanges

        public void after_mutual_exclusive_actions_entity_state_is_HasBackwardChanges()
        {
            EntityTrackingStates expected = EntityTrackingStates.HasBackwardChanges;

            IChangeTrackingService svc = new ChangeTrackingService();

            PersonCollection p = new PersonCollection( svc );
            p.Add( new Person( svc, false ) );
            p.RemoveAt( 0 );

            EntityTrackingStates actual = svc.GetEntityState( p );
            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:13,代碼來源:CollectionChangeTrackingServiceTests.cs

示例13: after_acceptChanges_entity_is_no_more_changed

        public void after_acceptChanges_entity_is_no_more_changed()
        {
            EntityTrackingStates expected = EntityTrackingStates.None;

            ChangeTrackingService svc = new ChangeTrackingService();

            PersonCollection p = new PersonCollection( svc );
            p.Add( new Person( null, false ) );

            svc.AcceptChanges();

            EntityTrackingStates actual = svc.GetEntityState( p );
            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:14,代碼來源:CollectionChangeTrackingServiceTests.cs

示例14: unchangedEntity_service_getEntityState_is_None

        public void unchangedEntity_service_getEntityState_is_None()
        {
            EntityTrackingStates expected = EntityTrackingStates.None;

            ChangeTrackingService svc = new ChangeTrackingService();
            PersonCollection p = new PersonCollection( svc );

            EntityTrackingStates actual = svc.GetEntityState( p );

            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:11,代碼來源:CollectionChangeTrackingServiceTests.cs

示例15: service_registerTransient_valid_reference_and_explicit_autoRemove_false

        public void service_registerTransient_valid_reference_and_explicit_autoRemove_false()
        {
            EntityTrackingStates expected = EntityTrackingStates.IsTransient;

            ChangeTrackingService svc = new ChangeTrackingService();
            Person p = new Person( svc, false );
            svc.RegisterTransient( p, false );

            EntityTrackingStates actual = svc.GetEntityState( p );

            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:12,代碼來源:EntityChangeTrackingServiceTests.cs


注:本文中的Topics.Radical.ChangeTracking.ChangeTrackingService.GetEntityState方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。