示例#1
0
 /// <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);
 }
示例#2
0
 /// <summary>
 /// 初始化树型路径更新服务
 /// </summary>
 /// <param name="repository">仓储</param>
 public UpdatePathManager(ITreeCompactRepository <TEntity, TKey, TParentId> repository)
 {
     _repository = repository;
 }