当前位置: 首页>>代码示例>>C#>>正文


C# ChangeTrackingService.RegisterTransient方法代码示例

本文整理汇总了C#中Topics.Radical.ChangeTracking.ChangeTrackingService.RegisterTransient方法的典型用法代码示例。如果您正苦于以下问题:C# ChangeTrackingService.RegisterTransient方法的具体用法?C# ChangeTrackingService.RegisterTransient怎么用?C# ChangeTrackingService.RegisterTransient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Topics.Radical.ChangeTracking.ChangeTrackingService的用法示例。


在下文中一共展示了ChangeTrackingService.RegisterTransient方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChangeTrackingService

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

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

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

				op.Complete();
			}

			var actual = target.HasTransientEntities;

			actual.Should().Be.True();
		}
开发者ID:nazarenomanco,项目名称:Radical,代码行数:21,代码来源:AtomicChangesChangeTrackingServiceTests.cs

示例2: after_suspend_cannot_call_RegisterTransient_with_explicit_autoRemove_false

        public void after_suspend_cannot_call_RegisterTransient_with_explicit_autoRemove_false()
        {
            ChangeTrackingService svc = new ChangeTrackingService();

            Person p = new Person( svc, false );
            svc.Suspend();
            svc.RegisterTransient( p, false );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:8,代码来源:EntityChangeTrackingServiceTests.cs

示例3: changeTrackingService_using_beginAtomicOperation_getEntities_should_return_all_transient_entities

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

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

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

				op.Complete();
			}

			var actual = target.GetEntities( EntityTrackingStates.IsTransient, false );

			actual.Contains( person ).Should().Be.True();
		}
开发者ID:nazarenomanco,项目名称:Radical,代码行数:21,代码来源:AtomicChangesChangeTrackingServiceTests.cs

示例4: 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

示例5: after_suspend_cannot_call_RegisterTransient

        public void after_suspend_cannot_call_RegisterTransient()
        {
            ChangeTrackingService svc = new ChangeTrackingService();

            Person p = new Person( svc, false );
            svc.Suspend();
            svc.RegisterTransient( p );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:8,代码来源:EntityChangeTrackingServiceTests.cs

示例6: explicit_registerAsTransient_without_autoRemove_throws_exception_if_already_registered

        public void explicit_registerAsTransient_without_autoRemove_throws_exception_if_already_registered()
        {
            ChangeTrackingService svc = new ChangeTrackingService();

            Person p = new Person( svc );
            svc.RegisterTransient( p, false );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:7,代码来源:EntityChangeTrackingServiceTests.cs

示例7: entity_registeredAsTransient_without_autoRemove_on_AcceptChanges_is_no_more_transient

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

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

            EntityTrackingStates actual = svc.GetEntityState( p );

            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:13,代码来源:EntityChangeTrackingServiceTests.cs

示例8: 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

示例9: after_explicit_registerAsTransient_with_autoRemove_false_entityTrackingStates_is_transient

        public void after_explicit_registerAsTransient_with_autoRemove_false_entityTrackingStates_is_transient()
        {
            ChangeTrackingService svc = new ChangeTrackingService();
            EntityTrackingStates expected = EntityTrackingStates.IsTransient;

            Person p = new Person( svc, false );
            svc.RegisterTransient( p, false );
            EntityTrackingStates actual = svc.GetEntityState( p );

            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:11,代码来源:EntityChangeTrackingServiceTests.cs

示例10: service_on_registerTransient_with_explicit_autoRemove_true_raise_trackingServiceStateChanged_event

        public void service_on_registerTransient_with_explicit_autoRemove_true_raise_trackingServiceStateChanged_event()
        {
            Int32 expected = 1;
            Int32 actual = 0;

            ChangeTrackingService svc = new ChangeTrackingService();
            svc.TrackingServiceStateChanged += ( sender, args ) => { actual++; };

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

            Assert.AreEqual<Int32>( expected, actual );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:13,代码来源:EntityChangeTrackingServiceTests.cs

示例11: 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

示例12: service_double_registerTransient_with_same_reference_invalidOperationException

 public void service_double_registerTransient_with_same_reference_invalidOperationException()
 {
     ChangeTrackingService svc = new ChangeTrackingService();
     Person p = new Person( svc );
     svc.RegisterTransient( p );
 }
开发者ID:RadicalFx,项目名称:Radical,代码行数:6,代码来源:EntityChangeTrackingServiceTests.cs

示例13: service_registerTransient_null_reference_explicit_autoRemove_false_argumentNullException

 public void service_registerTransient_null_reference_explicit_autoRemove_false_argumentNullException()
 {
     ChangeTrackingService svc = new ChangeTrackingService();
     svc.RegisterTransient( null, false );
 }
开发者ID:RadicalFx,项目名称:Radical,代码行数:5,代码来源:EntityChangeTrackingServiceTests.cs

示例14: service_registerTransient_null_reference_argumentNullException

 public void service_registerTransient_null_reference_argumentNullException()
 {
     ChangeTrackingService svc = new ChangeTrackingService();
     svc.RegisterTransient( null );
 }
开发者ID:RadicalFx,项目名称:Radical,代码行数:5,代码来源:EntityChangeTrackingServiceTests.cs


注:本文中的Topics.Radical.ChangeTracking.ChangeTrackingService.RegisterTransient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。