Files
DigitalData.Core/DigitalData.Core.Contracts/Authentication/Services/IADService.cs
Developer 02 67d5385c56 initial commit
2024-03-06 16:14:36 +01:00

28 lines
1.3 KiB
C#

using System.DirectoryServices;
namespace DigitalData.Core.Contracts.Authentication.Services
{
/// <summary>
/// Defines the contract for a service that interacts with Active Directory (AD) to search and read AD entries into objects of type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">The type of the objects to which AD entries will be mapped.</typeparam>
public interface IADService<T> where T : new()
{
/// <summary>
/// Performs a search in Active Directory and returns all matching entries.
/// </summary>
/// <returns>A collection of search results containing all matching Active Directory entries.</returns>
public SearchResultCollection SearchAll();
/// <summary>
/// Reads all search results and maps them to a collection of objects of type <typeparamref name="T"/>.
/// </summary>
/// <returns>An enumerable collection of objects of type <typeparamref name="T"/>, each representing an Active Directory entry.</returns>
public IEnumerable<T> ReadAll();
/// <summary>
/// Gets the <see cref="DirectorySearcher"/> instance used for executing searches against Active Directory.
/// </summary>
public DirectorySearcher Searcher { get; }
}
}