File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
Main/Source/NMemory.Shared Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public interface IIndex
3636
3737 long Count { get ; }
3838
39- //// void Clear();
39+ void Clear ( ) ;
4040
4141 void Rebuild ( ) ;
4242 }
Original file line number Diff line number Diff line change @@ -198,5 +198,10 @@ public void Rebuild()
198198 this . DataStructure . Insert ( this . KeyInfo . SelectKey ( entity ) , entity ) ;
199199 }
200200 }
201+
202+ public void Clear ( )
203+ {
204+ this . DataStructure . Clear ( ) ;
205+ }
201206 }
202207}
Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ public abstract class Table<TEntity, TPrimaryKey> :
6363
6464 #region Fields
6565
66- private readonly IdentityField < TEntity > identityField ;
66+ private IdentityField < TEntity > identityField ;
67+ private readonly IdentitySpecification < TEntity > originalIdentitySpecification ;
6768 private readonly IUniqueIndex < TEntity , TPrimaryKey > primaryKeyIndex ;
6869 private readonly IList < IIndex < TEntity > > indexes ;
6970 private readonly IEntityService entityService ;
@@ -109,6 +110,7 @@ public Table(
109110 if ( identitySpecification != null )
110111 {
111112 this . identityField = new IdentityField < TEntity > ( identitySpecification ) ;
113+ this . originalIdentitySpecification = identitySpecification ;
112114 }
113115 }
114116
@@ -806,5 +808,10 @@ private void RegisterTimestampConstraints()
806808 this . Contraints . Add ( new TimestampConstraint < TEntity > ( lambda ) ) ;
807809 }
808810 }
811+
812+ public void RestoreIdentityField ( )
813+ {
814+ identityField = new IdentityField < TEntity > ( this . originalIdentitySpecification ) ;
815+ }
809816 }
810817}
You can’t perform that action at this time.
0 commit comments