public void GetSubFolder(BaseFolder folder, IList <string> paths) { paths.Add(folder.GetFullHashPath()); var type = folder.GetType(); var properties = type.GetProperties() .Where(x => x.CustomAttributes.Any(y => y.AttributeType == typeof(FolderAttribute))).ToList(); foreach (var property in properties) { GetSubFolder((BaseFolder)property.GetValue(folder), paths); } }
public void GetSubFolder(BaseFolder folder, IList <string> paths) { _logger.LogInformation($"{nameof(FileService)}.{nameof(GetSubFolder)}.Start"); paths.Add(folder.GetFullHashPath()); var type = folder.GetType(); var properties = type.GetProperties() .Where(x => x.CustomAttributes.Any(y => y.AttributeType == typeof(FolderAttribute))).ToList(); foreach (var property in properties) { GetSubFolder((BaseFolder)property.GetValue(folder), paths); } _logger.LogInformation($"{nameof(FileService)}.{nameof(GetSubFolder)}.End"); }