本文整理匯總了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 );
}