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