Projektstruktur optimiert und Benutzer- & Gruppenverzeichnisdienste abgeschlossen.
This commit is contained in:
11
DigitalData.Core.Contracts/Infrastructure/IADDataAccessor.cs
Normal file
11
DigitalData.Core.Contracts/Infrastructure/IADDataAccessor.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.DirectoryServices;
|
||||
|
||||
namespace DigitalData.Core.Contracts.Infrastructure
|
||||
{
|
||||
public interface IADDataAccessor
|
||||
{
|
||||
SearchResultCollection ReadAll();
|
||||
|
||||
SearchResult? ReadOne();
|
||||
}
|
||||
}
|
||||
44
DigitalData.Core.Contracts/Infrastructure/ICRUDRepository.cs
Normal file
44
DigitalData.Core.Contracts/Infrastructure/ICRUDRepository.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
namespace DigitalData.Core.Contracts.Infrastructure
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the contract for CRUD operations on a repository for entities of type TEntity.
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">The type of the entity this repository works with.</typeparam>
|
||||
/// <typeparam name="TId">The type of the identifier for the entity.</typeparam>
|
||||
public interface ICRUDRepository<TEntity, TId> where TEntity : class
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds a new entity to the repository.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity to add.</param>
|
||||
/// <returns>The added entity, or null if the entity cannot be added.</returns>
|
||||
Task<TEntity?> CreateAsync(TEntity entity);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves an entity by its identifier from the repository.
|
||||
/// </summary>
|
||||
/// <param name="id">The identifier of the entity to retrieve.</param>
|
||||
/// <returns>The entity found, or null if no entity is found.</returns>
|
||||
Task<TEntity?> ReadByIdAsync(TId id);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves all entities from the repository.
|
||||
/// </summary>
|
||||
/// <returns>A collection of all entities.</returns>
|
||||
Task<IEnumerable<TEntity>> ReadAllAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Updates an existing entity in the repository.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity to update.</param>
|
||||
/// <returns>The updated entity.</returns>
|
||||
Task<bool> UpdateAsync(TEntity entity);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an entity from the repository.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity to delete.</param>
|
||||
/// <returns>If entity is deleted, return true othwerwise return false.</returns>
|
||||
Task<bool> DeleteAsync(TEntity entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.DirectoryServices;
|
||||
|
||||
namespace DigitalData.Core.Contracts.Infrastructure
|
||||
{
|
||||
public interface ISearcherProvider<ADDataAccessor>
|
||||
{
|
||||
public Func<DirectorySearcher> Provide { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user