/// <summary> /// Open the given objectId ForRead inside of a new transaction and then call the specified function; /// the transaction will be Commit()ted. /// </summary> public static TResult Use <TDBObject, TResult>(this ObjectId <TDBObject> id, Func <TDBObject, TResult> f) where TDBObject : DBObject { lock (Runtime.DBSyncObject) { return(TransactionUtilities.UseId(id, OpenMode.ForRead, f)); } }
/// <summary> /// Open the given objectId ForWrite inside of a new transaction and then call the specified function; /// the transaction will be Commit()ted. /// </summary> public static TResult UseForWrite <TDBObject, TResult>(this ObjectId <TDBObject> id, Func <TDBObject, TResult> f) where TDBObject : DBObject { return(TransactionUtilities.UseId(id, OpenMode.ForWrite, f)); }