Commit Graph

642 Commits

Author SHA1 Message Date
Developer 02
e0737299cf Bump version to 1.1.1 in project file
Updated DigitalData.Core.Exceptions.csproj to set <Version>, <AssemblyVersion>, and <FileVersion> to 1.1.1, replacing the previous 1.1.0 values. No other changes were made.
2026-01-21 22:06:35 +01:00
Developer 02
2db99edcda Add constructor to BadRequestException for inner exceptions
Added a new constructor to BadRequestException that accepts both a message and an inner exception, enabling improved exception chaining and more detailed error reporting.
2026-01-21 22:05:16 +01:00
65186b4f47 chore(Infrastructure): bump to 2.6.1 2026-01-12 10:23:26 +01:00
eb3a5b8991 Apply AsNoTracking to raw/interpolated queries in DbRepository
QueryRaw and QueryInterpolated now always return results with AsNoTracking applied, ensuring entities are not tracked by EF Core. Both methods are now virtual, allowing for easier customization in derived classes. This change improves performance and prevents unintended side effects from entity tracking.
2026-01-12 10:02:56 +01:00
908d85c648 refactor(Core.Abstraction.Application): bump to 1.6.0 2025-12-19 10:23:45 +01:00
d0f055e066 Bump version to 2.6.0 in csproj metadata
Updated <Version>, <AssemblyVersion>, and <FileVersion> fields in DigitalData.Core.Infrastructure.csproj from 2.5.2 to 2.6.0 to reflect the new release.
2025-12-19 10:13:25 +01:00
7f9e6155fe Add repository registration to DI setup
Added RegsRepository.InvokeAll(services) to the dependency injection configuration, ensuring repository types are registered alongside entities and DbSet factories.
2025-12-19 10:11:14 +01:00
1e3cba6fdf Refactor DependencyInjection and RepositoryConfiguration classes
Restructure code for improved readability and maintainability. Move RepositoryConfiguration as a nested public class inside DependencyInjection, group related service registration logic, and clarify method organization. No functional changes.
2025-12-19 10:09:04 +01:00
daa36d767d Refactor repository registration to be context-based
Changed RegisterDefaultRepository to register repositories by DbContext only, removing the entity-specific generic parameter. Added a private InvokeAll<T> helper to process queued service registrations. This streamlines repository registration and improves code maintainability.
2025-12-19 10:03:25 +01:00
3021fd36f6 Implement IRepository in DbRepository<TDbContext>
DbRepository<TDbContext> now implements the IRepository interface, ensuring it conforms to the expected repository contract and interface requirements. This change improves consistency and enforces interface adherence across repository implementations.
2025-12-19 10:01:20 +01:00
2c704c1231 Add raw SQL support to repository interfaces and DI
Extended IRepository interfaces and DbRepository implementation to support raw and interpolated SQL query execution (sync/async) and querying. Updated DependencyInjection to allow registration of default repository implementations. Added Microsoft.EntityFrameworkCore.Abstractions as a dependency. Performed minor refactoring and cleanup.
2025-12-19 09:54:56 +01:00
2bf2bb2276 Refactor namespace and add System.Linq import
Removed conditional compilation around the namespace in DbRepository.cs, making it always use standard braces. Added System.Linq using directive to support LINQ operations.
2025-12-19 09:51:22 +01:00
Developer 02
d2302560f1 Add repository registration to DependencyInjection
Added a `RegsRepository` queue to manage repository registrations.
Introduced `RegisterDefaultRepository<TDbContext, TEntity>()` to
enqueue scoped repository registrations. Updated `RegisterAllServices`
to process the `RegsRepository` queue during service registration.
2025-12-19 09:25:58 +01:00
Developer 02
42c0dc7206 Refactor method names for clarity in IRepository/DbRepository
Renamed methods in `IRepository` and `DbRepository` to replace
`Sql` with `Query` for improved clarity and consistency.

- Updated `IRepository` methods:
  - `ExecuteSqlRawAsync` -> `ExecuteQueryRawAsync`
  - `ExecuteSqlInterpolatedAsync` -> `ExecuteQueryInterpolatedAsync`
  - `ExecuteSqlRaw` -> `ExecuteQueryRaw`
  - `ExecuteSqlInterpolated` -> `ExecuteQueryInterpolated`

- Updated `DbRepository` methods:
  - `ExecuteSqlRawAsync` -> `ExecuteQueryRawAsync`
  - `ExecuteSqlInterpolatedAsync` -> `ExecuteQueryInterpolatedAsync`
  - `ExecuteSqlRaw` -> `ExecuteQueryRaw`
  - `ExecuteSqlInterpolated` -> `ExecuteQueryInterpolated`

- Fixed `DbRepository` class declaration by removing the incorrect
  constraint requiring `TDbContext` to implement `IRepository`.
2025-12-19 09:20:18 +01:00
Developer 02
82686db38b Add QueryRaw and QueryInterpolated methods to repository
Added `QueryRaw` and `QueryInterpolated` methods to the
`IRepository` interface for raw and interpolated SQL queries,
conditionally compiled for the `NET` target framework.

Removed the `Sql` method from `DbRepository` and replaced it
with implementations of `QueryRaw` and `QueryInterpolated`
using `Entities.FromSqlRaw` and `Entities.FromSqlInterpolated`.

Updated the `Query` property in `DbRepository` to use
`Entities.AsNoTracking()` for read-only queries.
2025-12-19 09:05:59 +01:00
Developer 02
ce5c59dfc2 Update DbRepository to require IRepository constraint
The `DbRepository` class now enforces that the generic type
parameter `TDbContext` must implement the `IRepository`
interface in addition to inheriting from `DbContext`. This
ensures that `DbRepository` can leverage functionality
provided by the `IRepository` interface, improving type
safety and consistency.
2025-12-19 08:57:18 +01:00
Developer 02
5c3db6886a Add EF Core support and refactor IRepository interface
Updated project dependencies to include `Microsoft.EntityFrameworkCore.Abstractions` for multiple target frameworks (`net462`, `net7.0`, `net8.0`, `net9.0`). Added `Microsoft.Extensions.*` package references to the project file.

Enhanced `IRepository` interface with methods for executing raw and interpolated SQL queries (`ExecuteSqlRawAsync`, `ExecuteSqlInterpolatedAsync`, etc.). Adjusted method declarations to support conditional compilation for `NET` and `NETFRAMEWORK`.

Refactored namespace structure in `IRepository.cs` to simplify and remove unnecessary conditional compilation directives.
2025-12-18 22:09:45 +01:00
Developer 02
144178a504 Add async SQL execution methods to DbRepository
Added `ExecuteSqlRawAsync` and `ExecuteSqlInterpolatedAsync` methods to the `DbRepository` class for asynchronous SQL execution. Updated the `System.Linq` namespace import to support LINQ operations. Simplified conditional compilation directives by consistently enclosing the class declaration in braces `{}` across frameworks. Adjusted closing braces to align with the updated structure.
2025-12-18 21:54:22 +01:00
6717aa37ab Add generic DbRepository for raw SQL execution
Introduced DbRepository<TDbContext> to provide basic database operations, including methods for executing raw SQL commands via ExecuteSqlRaw and ExecuteSqlInterpolated. The class exposes the underlying DbContext for use in derived classes. Existing DbRepository<TDbContext, TEntity> remains unchanged.
2025-12-18 13:44:45 +01:00
bf418e986b Add Sql method to DbRepository and EFCore.Relational refs
Added a Sql method to DbRepository for executing raw SQL queries
via FromSqlRaw. Included Microsoft.EntityFrameworkCore.Relational
package references for all target frameworks to support this
functionality. Cleaned up unused using directives.
2025-12-18 13:21:35 +01:00
9f2a13df6f bump to 2.5.2 2025-11-06 00:25:15 +01:00
0cf6d2690a chore(Infrastructure): bump to 2.5.0 2025-11-05 14:22:22 +01:00
afbbac7b81 core(Abstraction.Application): bump to 1.5.0 2025-11-05 14:21:29 +01:00
d16a4b6bb4 refactor(repository): make UpdateAsync more flexible with Action<TEntity>
- Introduced Action<TEntity>-based UpdateAsync method for more flexible updates
- Updated TDto-based UpdateAsync to delegate to the new method
- Reduced code duplication and Mapper dependency
- Preserved existing Create, Read, and Delete functionality
2025-11-05 14:20:12 +01:00
5567f6731b chore(Core.Abstractions): bump to 4.3.0 2025-10-29 16:25:32 +01:00
fc297d92fa feat(factory): add IServiceScopeFactory property to Factory class
Added ScopeFactory property to the Factory class to expose IServiceScopeFactory through GetRequiredService<IServiceScopeFactory>().
This enables scoped service creation from the factory instance.
2025-10-29 16:08:43 +01:00
50a056d110 feat(Factory): add PostBuildBehavior to control post-build modification behavior in Factory
Introduced PostBuildBehavior enum and BehaveOnPostBuild() method to configure behavior when modifying the service collection after the service provider is built.
Replaced EnsureNotBuilt() with EnsureBuilt() to support configurable handling (throw exception or ignore).
This improves flexibility in scenarios where post-build service modifications should be optionally allowed or silently ignored.
2025-10-29 15:57:36 +01:00
d87f36898b chore(Abstraction.Application): bump to 1.4.0 2025-10-23 10:30:50 +02:00
62e43024a6 chore(Abstractions): bump to 4.2.0 2025-10-23 10:29:41 +02:00
daa3f4d5be feat: add IServiceProvider extension to resolve IRepository<TEntity> 2025-10-23 10:27:57 +02:00
10ff9b9745 refactor(Factory): rename Instance as Shared 2025-10-23 10:19:59 +02:00
ea2340974a refactor(FactoryTests): created unit tests for Factory 2025-10-23 10:18:14 +02:00
fbf9488c55 feat(Factory): prevent service modifications after provider is built
Added an `IsBuilt` property and `EnsureNotBuilt()` helper to `Factory` class
to restrict modifications to the service collection once the service provider
has been built. This ensures immutability and prevents runtime inconsistencies
after initialization.
2025-10-23 09:53:50 +02:00
ddbb70081e fix(factory): return requested service from IServiceProvider in GetService method 2025-10-23 09:49:38 +02:00
c538a8df8c feat(Factory): add Factory class implementing IServiceProvider and IServiceCollection
- Introduced Factory class in DigitalData.Core.Abstractions namespace
- Implements both IServiceProvider and IServiceCollection interfaces
- Provides singleton instance via static readonly Instance property
- Supports lazy initialization of IServiceProvider using Lazy<T>
- Includes full collection management (Add, Remove, Clear, etc.)
- Ensures compatibility with both .NET and .NET Framework via conditional directives
2025-10-23 09:47:18 +02:00
f500d9d974 chore(Abstractions): update package references and add dependency injection packages
- Added Microsoft.Extensions.DependencyInjection and Abstractions for net462
- Added Microsoft.Extensions.DependencyInjection for net7.0, net8.0, and net9.0
- Updated Microsoft.Extensions.* package versions for net8.0 and net9.0 to 9.0.10
2025-10-23 09:27:26 +02:00
f2808d090f refactor(Infrastructure): bump to 2.4.5 2025-10-22 17:42:57 +02:00
0084e6f758 refactor(Abstraction.Application): bump to 1.3.7 2025-10-22 17:37:39 +02:00
90ce4e487c refactor: remove IRepository and DbRepository 2025-10-22 17:34:28 +02:00
1febae72c2 refactor(DbRepositoryFactory): remvoed 2025-10-22 17:26:31 +02:00
3b825d4ea3 refactor(Abstraction.Repository): removed 2025-10-13 13:48:46 +02:00
a06adfdcdf chore: bump Abstraction.Application to v1.3.6 and Infrastructure to v2.4.4 2025-10-13 12:05:03 +02:00
00e5f6c0e9 refactor(Repository): add Query getter metod to Repository calss and interface to be able to create read-only query without expression 2025-10-13 11:55:49 +02:00
1e35692a02 bump to 1.3.5 2025-10-01 15:14:25 +02:00
a6048238d4 refactor(IFactory): add Repository getter method 2025-10-01 15:14:01 +02:00
8708f54996 chore(Abstraction.Application): bump to 1.3.4 2025-10-01 15:09:48 +02:00
568f5990b2 refactor: replace Static service accessor with Factory implementation
- Replaced `Static` class with `Factory` class to unify service collection and provider handling.
- Introduced `Factory.Shared` singleton for centralized access to `IServiceProvider`.
- Updated generic repository access to use `Factory<TEntity>` instead of `Static<TEntity>`.
- Simplified lazy initialization of the service provider.
- Maintains compatibility with .NET Framework and .NET conditional compilation.
2025-10-01 15:08:54 +02:00
Developer 02
b8751379c5 Bump version numbers for core projects
Updated `DigitalData.Core.Abstraction.Application` to version 1.3.3 and `DigitalData.Core.Infrastructure` to version 2.4.3. These changes reflect minor updates, likely including bug fixes and small enhancements.
2025-09-30 21:08:32 +02:00
Developer 02
a38447a36f Refactor for .NET framework compatibility
Added preprocessor directives to conditionally include
code for different .NET frameworks. Adjusted namespace
declarations and organized the `Static` class for
improved clarity and maintainability.
2025-09-30 21:04:32 +02:00
Developer 02
fde0398c89 Bump version to 2.4.2 in project file
Updated the version number, assembly version, and file version from 2.4.1 to 2.4.2 in the DigitalData.Core.Infrastructure.csproj file.
2025-09-30 20:00:36 +02:00