AcManager.LargeFilesSharing.DirectoryEntryLinqExtension.GetChildById C# (CSharp) Method

GetChildById() private method

private GetChildById ( [ source, string id ) : DirectoryEntry
source [
id string
return DirectoryEntry
        public static DirectoryEntry GetChildById([NotNull] this IEnumerable<DirectoryEntry> source, string id) {
            if (source == null) throw new ArgumentNullException(nameof(source));
            foreach (var i in source) {
                if (Equals(i.Id, id)) return i;
                var child = i.Children.GetChildByIdOrDefault(id);
                if (child != null) return child;
            }
            throw new Exception(@"Element with given ID not found");
        }
DirectoryEntryLinqExtension