/// <summary> /// 更新实体以及所有下级节点路径 /// </summary> /// <typeparam name="TEntity">实体类型</typeparam> /// <typeparam name="TKey">标识类型</typeparam> /// <typeparam name="TParentId">父标识类型</typeparam> /// <param name="repository">仓储</param> /// <param name="entity">实体</param> /// <returns></returns> public static async Task UpdatePathAsync <TEntity, TKey, TParentId>( this ITreeCompactRepository <TEntity, TKey, TParentId> repository, TEntity entity) where TEntity : class, ITreeEntity <TEntity, TKey, TParentId> { var manager = new UpdatePathManager <TEntity, TKey, TParentId>(repository); await manager.UpdatePathAsync(entity); }
/// <summary> /// 测试初始化 /// </summary> public UpdatePathManagerTest() { _mockRepository = Substitute.For <IRoleRepository>(); _manager = new UpdatePathManager <Role, Guid, Guid?>(_mockRepository); }