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


C# ChangeTrackingService.GetEntities方法代码示例

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


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

示例1: changeTrackingService_using_beginAtomicOperation_getEntities_should_return_all_changed_entities

		public void changeTrackingService_using_beginAtomicOperation_getEntities_should_return_all_changed_entities()
		{
			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.GetEntities( EntityTrackingStates.HasBackwardChanges, false );

			/*
			 * Non funziona perchè non funziona GetEntityState()
			 */

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

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

示例3: unchangedTransientEntity_service_RejectChanges_entity_is_not_transient

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

            Person p = new Person( svc );

            svc.RejectChanges();

            var list = svc.GetEntities( EntityTrackingStates.IsTransient, false );
            var persons = list.OfType<Person>();

            Assert.IsFalse( persons.Contains( p ) );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:13,代码来源:EntityChangeTrackingServiceTests.cs

示例4: service_initial_state_has_no_transient_entities

        public void service_initial_state_has_no_transient_entities()
        {
            ChangeTrackingService svc = new ChangeTrackingService();
            IEnumerable entities = svc.GetEntities( EntityTrackingStates.IsTransient, false );

            Assert.AreEqual<Int32>( 0, entities.OfType<Object>().Count() );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:7,代码来源:EntityChangeTrackingServiceTests.cs

示例5: unchangedTransientEntity_service_getTransientEntities_contains_entity

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

            Person p = new Person( svc );

            var list = svc.GetEntities( EntityTrackingStates.IsTransient, false );
            var persons = list.OfType<Person>();

            Assert.IsTrue( persons.Contains( p ) );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:11,代码来源:EntityChangeTrackingServiceTests.cs

示例6: service_getEntities_state_Transient_exactMatch_false_entity_in_Changed_and_Transient_state

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

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

            IEnumerable<Object> entities = svc.GetEntities( EntityTrackingStates.IsTransient, false );

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

示例7: service_getEntities_state_Changed_exactMatch_true_entity_in_Changed_state

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

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

            IEnumerable<Object> entities = svc.GetEntities( EntityTrackingStates.HasBackwardChanges, true );

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

示例8: service_getEntities_gets_all_tracked_entities

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

            Person p1 = new Person( svc, true );
            p1.Name = "Mauro";
            p1.Name = "Mauro";
            p1.Name = "Foo";

            Person p2 = new Person( svc, true );

            IEnumerable<Object> entities = svc.GetEntities();

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

示例9: service_getEntities_state_None_exactMatch_false_gets_all_tracked_entities

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

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

            IEnumerable<Object> entities = svc.GetEntities( EntityTrackingStates.None, false );

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


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