fix(DirectorySearchQuery): Umbenennen von „properties-property“ in „Property“
This commit is contained in:
parent
25812a0a7d
commit
d0de978c7d
@ -6,7 +6,7 @@ using System.DirectoryServices;
|
|||||||
|
|
||||||
namespace DigitalData.ActiveDirectory;
|
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>>
|
: IRequest<IEnumerable<ResultPropertyCollection>>
|
||||||
{
|
{
|
||||||
public Action<DirectorySearcher>? AfterInit { get; set; }
|
public Action<DirectorySearcher>? AfterInit { get; set; }
|
||||||
@ -43,10 +43,10 @@ public class DirectorySearchQueryHandler : IRequestHandler<DirectorySearchQuery,
|
|||||||
|
|
||||||
request.AfterInit?.Invoke(searcher);
|
request.AfterInit?.Invoke(searcher);
|
||||||
|
|
||||||
if (request.properties.Length > 0)
|
if (request.Property.Length > 0)
|
||||||
searcher.PropertiesToLoad.Clear();
|
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);
|
var res = searcher.FindAll().Cast<SearchResult>().Select(r => r.Properties);
|
||||||
return res.Any() ? res : throw new NotFoundException();
|
return res.Any() ? res : throw new NotFoundException();
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user