478 Commits

Author SHA1 Message Date
Developer 02
9d36ced82f feat: Hinzufügen von Erweiterungsmethoden zum Abrufen von Konfigurationsoptionen von IServiceProvider
- Implementiert GetOptions<TOptions> zum Abrufen von Optionen oder null.
- Implementiert GetRequiredOptions<TOptions> für den Abruf von Optionen oder das Auslösen einer Ausnahme.
2025-04-28 16:10:31 +02:00
Developer 02
c81ff2c628 feat(ConfigurationExtension): Hinzufügen der Klasse ConfigurationExtension mit der Methode GetOrDefault zum sichereren Abrufen von Konfigurationen
- Einführung einer neuen statischen Klasse ConfigurationExtension im Namespace DigitalData.Core.Abstractions.
- Hinzufügen der GetOrDefault-Erweiterungsmethode zu IConfiguration, die eine einfachere Abfrage von Konfigurationswerten mit Standardverhalten ermöglicht, wenn diese nicht gefunden werden.
- Aktualisierung der Versionsnummern auf 3.5.0 in den Projektdateien.
2025-04-28 15:44:01 +02:00
Developer 02
653665bb25 refactor(LazyServiceProvider.cs): rename DeferredServiceProvider.cs 2025-04-28 14:58:30 +02:00
Developer 02
17edf605e7 chore(Abstractions): Aktualisiert auf 3.4.4 2025-04-28 14:57:29 +02:00
Developer 02
b41373339e feat(core): DeferredServiceProvider für verzögerte IServiceProvider-Initialisierung hinzugefügt 2025-04-28 14:56:25 +02:00
Developer 02
fb9449d701 chore: upradge versions 2025-04-22 23:05:04 +02:00
Developer 02
72f735272f feat(Repository): Add and implement ReadOrDefaultAsync method.
- add read method can map for each
2025-04-22 23:04:11 +02:00
Developer 02
304f5b7b4c chore: unnötiges Projektverzeichnis entfernt 2025-04-22 20:47:47 +02:00
Developer 02
0238310290 chore(Abstractions.Security): Hochgestuft auf 1.0.1 2025-04-22 20:46:09 +02:00
Developer 02
3ac0501231 chore: covert from debug to release to publish package 2025-04-22 18:11:34 +02:00
Developer 02
db8a560805 chore(Infrastructure.AutoMapper): Konfiguration für das Packen 2025-04-22 18:07:40 +02:00
Developer 02
e67361bfe1 chore(DigitalData.Core.Infrastructure): Hochgestuft auf 2.0.2 2025-04-22 18:00:29 +02:00
Developer 02
91594e80bf refactor(EntityConfigurationOptions): aktualisiert, um IServiceCollection mit Callback zu konfigurieren 2025-04-22 17:58:49 +02:00
Developer 02
8d98159ba8 fix: Korrektur der Update- und Löschlogik in DbRepository zur Vermeidung von Laufzeitproblemen 2025-04-22 17:33:55 +02:00
Developer 02
f1f5b9e16d refactor(DbRepositoryTests): Update AddDbRepository configuration 2025-04-22 16:32:17 +02:00
Developer 02
3955dede16 feat(EntityConfigurationOptions): Erstellt, um Entitäten wie Mapper konfigurieren zu können 2025-04-22 16:21:57 +02:00
Developer 02
65e834784a feat(EntityAutoMapper): Erstellt mit der Konfiguration der Dependency Injection. 2025-04-22 15:15:52 +02:00
Developer 02
3c1bbc1151 feat(Repository): CreateAsync-Methoden für DTO wurden in Erweiterungsmethoden konvertiert 2025-04-22 11:21:21 +02:00
Developer 02
5465fe5b49 feat(IEntityMapper): Erstellt, um Mapper zu abstrahieren.
- Integriert in IRepository und Repository
2025-04-22 11:10:55 +02:00
Developer 02
85787e7054 feat(DbRepositoryTests): ReadAsync_ShouldReturnUpdated und ReadAsync_ShouldNotReturnDeleted Tests 2025-04-22 10:09:47 +02:00
Developer 02
c955220310 feat (Mapping): Porfile hinzufügen 2025-04-22 09:53:20 +02:00
Developer 02
7d2098092a Refactor user DTOs and update faker method
- Aktualisiert `CreateUserDtoFaker` um `UserCreateDto` anstelle von `UserDto` zu generieren.
- Die Klasse `UserDto` wurde entfernt, da sie nicht mehr benötigt wird.
- Hinzufügen von `UserCreateDto` für die Erstellung von Benutzern, Erweiterung von `UserBase`.
- Einführung von `UserReadDto` zum Lesen von Benutzerdaten, ebenfalls eine Erweiterung von `UserBase`.
2025-04-17 17:39:48 +02:00
Developer 02
e3b9d2971b Refactor User and UserDto to inherit from UserBase
- Aktualisierte `User` und `UserDto` Klassen um von einer neuen `UserBase` Klasse zu erben.
- Verschieben der Eigenschaften `Vorname`, `Email` und `Alter` zu `UserBase`.
- Implementierung der überschriebenen Methoden `GetHashCode` und `Equals` sowohl in `User` als auch in `UserDto`, um die Eigenschaften der Basisklasse zu nutzen.
2025-04-17 17:36:07 +02:00
Developer 02
3a604ede88 Refactor user creation and retrieval in tests
Updated `DbRepositoryTests` to await `CreateAsync` directly for user creation. Changed assertion to compare the created user with the user retrieved from the repository, enhancing test accuracy.
2025-04-17 16:43:15 +02:00
Developer 02
476c86ff0a feat: Verbesserung von IRepository mit neuen asynchronen Methoden und Erweiterungen
Aktualisiert IRepository<TEntity> um UpdateAsync<TDto>, DeleteAsync<TDto> und eine neue Überladung von ReadAsync. Die frühere ReadAsync-Überladung für Core.Tests.Mock.User wurde entfernt.

Einführung einer neuen Extensions-Klasse mit Methoden für ReadFirstOrDefaultAsync, ReadFirstAsync, ReadSingleOrDefaultAsync und ReadSingleAsync unter Nutzung der aktualisierten ReadAsync-Methode.
2025-04-17 16:24:52 +02:00
Developer 02
9376fcff86 Enhance IRepository and update DbRepositoryTests
- Added ReadAsync method to IRepository for user retrieval.
- Introduced _userRepo field in DbRepositoryTests for better clarity.
- Modified Setup method to initialize _userRepo from the service provider.
- Updated CreateAsync_ShouldNotThrow to use _userRepo.
- Added ReadAsync_ShouldReturnCreated test for user retrieval validation.
2025-04-17 16:00:59 +02:00
Developer 02
06df97597e Refactor user creation tests in DbRepositoryTests
Die Testmethode `CreateAsync_ShouldPersistUser` wurde entfernt und `CreateAsync_ShouldNotThrow` mit Testfällen für die Erstellung einzelner und mehrerer Benutzer hinzugefügt. Die neue Methode prüft, dass `CreateAsync` keine Ausnahmen auslöst, während Benutzerdaten mit einem Faker erzeugt werden.
2025-04-17 15:48:06 +02:00
Developer 02
266d03e0a1 Add user creation test to DbRepositoryTests
This commit introduces a new test method `CreateAsync_ShouldPersistUser` in `DbRepositoryTests.cs`. The method tests the asynchronous creation of a user in the repository using the `Faker` library to generate user data. It asserts that no exceptions are thrown during the creation process. Additionally, the using directives have been updated to include `DigitalData.Core.Abstractions.Infrastructure`.
2025-04-17 15:31:37 +02:00
Developer 02
e752c6f6ab Add AutoMapper setup to DbRepositoryTests
This commit introduces a using directive for `System.Reflection` in `DbRepositoryTests.cs` to support reflection features. The `Setup` method is updated to include `AddAutoMapper`, ensuring AutoMapper services are registered for dependency injection in the test environment.
2025-04-17 15:17:57 +02:00
Developer 02
561a751de4 Update dependency injection and repository tests
Modified `AddDbRepository` method to allow broader entity types and registered `queryFactory` as a singleton. Added necessary using directives in `DbRepositoryTests.cs` and updated the `Setup` method to configure an in-memory database for testing with `MockDbContext` and `User` entity.
2025-04-17 15:05:23 +02:00
Developer 02
35050d65a8 Refactor Fake class and enhance MockDbContext
Updated the `Fake` class to introduce flexible methods for generating fake `User` and `UserDto` objects with optional parameters. Removed the static `UserFaker` instance and related properties.

Added a new `DbSet<User>` property to `MockDbContext` for improved management of `User` entities.
2025-04-17 14:47:37 +02:00
Developer 02
cf9041980d feat(Mock): Hinzufügen von gefälschten Daten und Benutzermodellen zum Testen
Aktualisiert `DigitalData.Core.Tests.csproj`, um `Bogus` zur Erzeugung gefälschter Daten einzuschließen. Fake.cs„ für die Erstellung von gefälschten “User"-Objekten hinzugefügt. MockDbContext" für das Testen von Datenbank-Interaktionen eingeführt. Definierte `User` und `UserDto` Klassen für die Benutzerdarstellung und Datenübertragung.
2025-04-17 14:34:00 +02:00
Developer 02
cf2ee73ca1 Update target frameworks to include .NET 9.0
Expanded the project's target frameworks to support .NET 9.0, in addition to .NET 7.0 and .NET 8.0.
2025-04-17 13:55:06 +02:00
Developer 02
52f6dc161e Add EF Core package references and DbRepositoryTests
Updated `DigitalData.Core.Tests.csproj` to include conditional
package references for Entity Framework Core and its InMemory
provider for net7.0, net8.0, and net9.0.

Added `DbRepositoryTests` class with setup and teardown
methods for managing the lifecycle of a host instance.
2025-04-17 13:54:25 +02:00
Developer 02
7670898e24 Hinzufügen der Projekte "src" und "tests" zur Projektmappe
Der Projektmappendatei `DigitalData.Core.sln` wurden zwei neue Projekte mit den Namen "src" und "tests" hinzugefügt. Das Projekt „src“ hat einen eindeutigen Bezeichner `{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}`, und das Projekt „tests“ hat den Bezeichner `{EDF84A84-1E01-484E-B073-383F7139C891}`. Darüber hinaus wurden in den Lösungseigenschaften mehrere verschachtelte Projektbeziehungen eingerichtet, die diese neuen Projekte mit den bestehenden Projekten verknüpfen.
2025-04-17 13:32:15 +02:00
Developer 02
f5b202c325 Enhance IRepository and DbRepository with DTO support
Updated IRepository<TEntity> to include new generic methods for creating and reading entities from DTOs. Modified UpdateAsync to accept DTOs instead of generic types. Implemented corresponding methods in DbRepository<TDbContext, TEntity> for mapping DTOs to entities during creation and updating processes.
2025-04-17 13:30:35 +02:00
Developer 02
fffbdf752f Revert "Add mapping methods to IRepository and DbRepository"
This reverts commit 6916e169b17fc22997f3fed178863f2e1ed5d059.
2025-04-17 13:15:22 +02:00
Developer 02
6916e169b1 Add mapping methods to IRepository and DbRepository
Updated the `IRepository<TEntity>` interface to include two new mapping methods: `Map<TSource>(TSource source)` and `Map<TDto>(TEntity source)`.

Implemented these methods in the `DbRepository<TDbContext, TEntity>` class, utilizing a `Mapper` for conversions between source types and entity types, as well as between entity types and DTOs.
2025-04-17 13:01:51 +02:00
Developer 02
0c529b199b Bump version numbers and enhance repository interfaces
- Incremented version numbers in project files for updates.
- Marked `ICRUDRepository` as obsolete; use `IRepository` instead.
- Improved parameter names and signatures in `IRepository`.
- Changed access modifiers in `DbRepository` for broader access.
- Updated `CreateAsync` and `UpdateAsync` methods for async operations.
- Implemented `ReadAsync` and `DeleteAsync` methods in `DbRepository`.
- Minor whitespace change in `.csproj` files.
- Retained package description in `DigitalData.Core.Infrastructure.csproj`.
2025-04-17 12:53:40 +02:00
Developer 02
5427a9722d Update package references and modify DbRepository access
- Added conditional package references for AutoMapper in
  `DigitalData.Core.Application.csproj` to support
  different target framework versions.

- Changed `DbRepository` class access modifier from
  `public` to `internal` to encapsulate implementation
  details within the current assembly.
2025-04-16 13:56:53 +02:00
Developer 02
bccfae59cd Update EntityFrameworkCore references for multiple frameworks
The project file `DigitalData.Core.Infrastructure.csproj` has been modified to include conditional `PackageReference` entries for different target frameworks. The previous reference to `Microsoft.EntityFrameworkCore` version `7.0.16` has been replaced with:
- version `7.0.20` for `net7.0`
- version `8.0.15` for `net8.0`
- version `9.0.4` for `net9.0`

This change ensures the project uses the appropriate version of Entity Framework Core based on the target framework.
2025-04-16 13:51:04 +02:00
Developer 02
4c55ecb427 Refactor DbRepository methods for clarity and extensibility
Updated methods in the `DbRepository` class to be virtual, allowing for overriding in derived classes. Renamed parameters from `dto` to `entity` and `dtos` to `entities` for improved clarity. All methods still throw `NotImplementedException` as implementations are pending.
2025-04-16 09:42:55 +02:00
Developer 02
a7e4291e42 Enhance DbRepository with AutoMapper integration
Added AutoMapper support by introducing an IMapper field.
Changed Context and Entities fields to readonly for better
encapsulation. Updated constructor to accept an IMapper
parameter, improving object mapping capabilities.
2025-04-16 09:39:14 +02:00
Developer 02
352b59dfdf Refactor IRepository to simplify CreateAsync methods
Updated IRepository<TEntity> to remove generic type parameters
from CreateAsync methods, now directly accepting TEntity.
Corresponding changes made in DbRepository to align method
signatures. Implementations still throw NotImplementedException.
2025-04-16 09:38:07 +02:00
Developer 02
1b793e2b75 Add CancellationToken support to IRepository methods
Updated the IRepository<TEntity> interface to include an optional CancellationToken parameter in the asynchronous methods: CreateAsync, ReadAsync, UpdateAsync, and DeleteAsync. Modified the DbRepository<TDbContext, TEntity> class to align with these changes, ensuring method signatures are consistent with the interface.
2025-04-16 09:17:38 +02:00
Developer 02
72603f836c Refactor repository pattern and dependency injection
This commit introduces a new `DbRepository` class implementing the `IRepository<TEntity>` interface, providing asynchronous methods for CRUD operations. The previous CRUD repository registration in `DIExtensions.cs` has been removed, indicating a shift in repository management. A new static class `DependencyInjection` has been added to facilitate the registration of `DbRepository` with the service collection, enhancing modularity and flexibility in database interactions.
2025-04-16 09:12:06 +02:00
Developer 02
162da9a16c Ablehnung von ICRUDRepository; Einführung der IRepository-Schnittstelle
Die `ICRUDRepository`-Schnittstelle wurde als veraltet markiert, was bedeutet, dass sie zugunsten der neuen `IRepository`-Schnittstelle abgelehnt wird. Die „IRepository“-Schnittstelle bietet eine verbesserte Abstraktion und Flexibilität, die Methoden zum Erstellen, Lesen, Aktualisieren und Löschen von Entitäten mit Unterstützung für asynchrone Operationen umfasst.
2025-04-15 18:40:50 +02:00
Developer 02
c0524cbca2 Update target frameworks to include .NET 9.0
Updated multiple project files to support .NET 9.0 alongside .NET 7.0 and .NET 8.0. Affected files include:
- DigitalData.Core.API.csproj
- DigitalData.Core.Abstractions.csproj
- DigitalData.Core.Application.csproj
- DigitalData.Core.Client.csproj
- DigitalData.Core.DTO.csproj
- DigitalData.Core.Infrastructure.csproj

This change enables the use of new features and improvements in .NET 9.0.
2025-04-15 16:19:23 +02:00
Developer 02
51c1f408d7 fix: Konflikte lösen 2025-03-25 12:45:27 +01:00
Developer 02
a034ecdb1b chore: Nuget-Pakete werden je nach Rahmenwerk bedingt konfiguriert. 2025-03-25 12:43:18 +01:00