fix(DirectorySearchQuery): Umbenennen von „properties-property“ in „Property“

This commit is contained in:
Developer 02 2025-08-05 14:28:09 +02:00
parent 25812a0a7d
commit d0de978c7d

View File

@ -6,7 +6,7 @@ using System.DirectoryServices;
namespace DigitalData.ActiveDirectory;
public record DirectorySearchQuery(string? Filter = null, SearchScope Scope = SearchScope.Subtree, int SizeLimit = 5000, params string[] properties)
public record DirectorySearchQuery(string? Filter = null, SearchScope Scope = SearchScope.Subtree, int SizeLimit = 5000, params string[] Property)
: IRequest<IEnumerable<ResultPropertyCollection>>
{
public Action<DirectorySearcher>? AfterInit { get; set; }
@ -43,10 +43,10 @@ public class DirectorySearchQueryHandler : IRequestHandler<DirectorySearchQuery,
request.AfterInit?.Invoke(searcher);
if (request.properties.Length > 0)
if (request.Property.Length > 0)
searcher.PropertiesToLoad.Clear();
searcher.PropertiesToLoad.AddRange(request.properties.Where(p => p is not null).ToArray());
searcher.PropertiesToLoad.AddRange(request.Property.Where(p => p is not null).ToArray());
var res = searcher.FindAll().Cast<SearchResult>().Select(r => r.Properties);
return res.Any() ? res : throw new NotFoundException();
});