本文整理汇总了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();
}
示例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();
}
示例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 ) );
}
示例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() );
}
示例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 ) );
}
示例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() );
}
示例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() );
}
示例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() );
}
示例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() );
}