本文整理汇总了C#中Topics.Radical.ChangeTracking.ChangeTrackingService.Detach方法的典型用法代码示例。如果您正苦于以下问题:C# ChangeTrackingService.Detach方法的具体用法?C# ChangeTrackingService.Detach怎么用?C# ChangeTrackingService.Detach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Topics.Radical.ChangeTracking.ChangeTrackingService
的用法示例。
在下文中一共展示了ChangeTrackingService.Detach方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: service_on_stopTracking_if_enetity_is_iMemento_removes_self
public void service_on_stopTracking_if_enetity_is_iMemento_removes_self()
{
ChangeTrackingService svc = new ChangeTrackingService();
Person p = new Person( svc );
p.Name = "Foo";
svc.Detach( p );
var actual = ( ( IMemento )p ).Memento;
Assert.IsNull( actual );
}
示例2: service_on_stopTracking_raise_trackingServiceStateChanged
public void service_on_stopTracking_raise_trackingServiceStateChanged()
{
Int32 expected = 1;
Int32 actual = 0;
ChangeTrackingService svc = new ChangeTrackingService();
Person p = new Person( svc );
p.Name = "Foo";
svc.TrackingServiceStateChanged += ( s, e ) => { actual++; };
svc.Detach( p );
Assert.AreEqual<Int32>( expected, actual );
}
示例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 );
}