Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.x.x
- name: Test on .Net 8
run: dotnet test TestsOnly.sln -f net8.0 --verbosity quiet --filter "Category!=IntegrationTest"
- name: Test on .Net 9
run: dotnet test TestsOnly.sln -f net9.0 --verbosity quiet --filter "Category!=IntegrationTest"
- name: Test on .Net 10
run: dotnet test TestsOnly.sln -f net10.0 --verbosity quiet --filter "Category!=IntegrationTest"
- name: Test on .Net 9
run: dotnet test TestsOnly.sln -f net9.0 --verbosity quiet --filter "Category!=IntegrationTest"
- name: Test on .Net 8
run: dotnet test TestsOnly.sln -f net8.0 --verbosity quiet --filter "Category!=IntegrationTest"

4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
dotnet pack ./Configuration/PrefixedAzureKeyVaultSecretManager/Odin.Configuration.PrefixedAzureKeyVaultSecretManager.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Data/SqlScriptsRunner/Odin.Data.SqlScriptsRunner.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./DesignContracts/Core/Odin.DesignContracts.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./DomainDrivenDesign/Abstractions/Odin.DomainDrivenDesign.Abstractions.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./DomainDrivenDesign/Core/Odin.DDD.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Email/Mailgun/Odin.Email.Mailgun.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Email/Office365/Odin.Email.Office365.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Email/Core/Odin.Email.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
Expand All @@ -78,7 +78,7 @@ jobs:
dotnet pack ./Utility/VaryingValues/Odin.Utility.VaryingValues.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Utility/Tax/Odin.Utility.Tax.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./System/Activator2/Odin.System.Activator2.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./DomainDrivenDesign/EntityFrameworkSqlRepository/Odin.DomainDrivenDesign.EntityFrameworkSqlRepository.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./DomainDrivenDesign/Repositories-EF/Odin.DDD.Repositories.EF.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
env:
CONFIGURATION: ${{env.BUILD_CONFIGURATION}}
PACKAGE_DIR: ${{env.PACKAGE_DIR}}
Expand Down
2 changes: 2 additions & 0 deletions Data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## About Odin.Domain
~~~~
5 changes: 2 additions & 3 deletions Data/SqlScriptsRunner/Odin.Data.SqlScriptsRunner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<RootNamespace>Odin.Data</RootNamespace>
<Description>Provides a SqlScriptsRunner that supports journalled and unjournalled execution of SQL database change and other scripts.
Useful for running database migration scripts at application deployment time.



</Description>
<NoWarn>CS1591</NoWarn>
Expand All @@ -26,6 +24,7 @@
<ProjectReference Include="..\..\System\Result\Odin.System.Result.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="../../Assets/icon.png" Pack="true" PackagePath="" />
<None Include="../../Assets/icon.png" Pack="true" PackagePath=""/>
<None Include="README.md" Pack="true" PackagePath=""/>
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions Data/SqlScriptsRunner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## About Odin.Domain
~~~~
35 changes: 35 additions & 0 deletions Data/Tests/Tests.Odin.Database.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<UserSecretsId>Tests.Odin.Data</UserSecretsId>
<ImplicitUsings>true</ImplicitUsings>
<NoWarn>1591;</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="xunit.v3" />
<PackageReference Include="Moq" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />

</ItemGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\System\Result\Odin.System.Result.csproj" />
<ProjectReference Include="..\EFSqlRepository\Odin.DDD.Repositories.EF.csproj" />
<ProjectReference Include="..\SqlScriptsRunner\Odin.Data.SqlScriptsRunner.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions DesignContracts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## About Odin.Domain
~~~~
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<PackageVersion Include="Polly.Core" Version="8.6.6" />
<PackageVersion Include="RabbitMQ.Client" Version="7.2.1" />
<PackageVersion Include="RazorLight" Version="2.3.1" />
<PackageVersion Include="Respawn" Version="7.0.0" />
<PackageVersion Include="SSH.NET" Version="2025.1.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="xunit.v3" Version="3.2.2" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

namespace Odin.DomainDrivenDesign
namespace Odin.DDD
{
/// <summary>
/// Base class for a domain event.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Odin.DomainDrivenDesign;
namespace Odin.DDD;

/// <summary>
/// Represents an exception originating from the core application domain.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Odin.DomainDrivenDesign;
namespace Odin.DDD;

/// <summary>
/// Marker interface to identify an 'aggregate root' entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Numerics;

namespace Odin.DomainDrivenDesign;
namespace Odin.DDD;

/// <summary>
/// Marker interface to identify an 'aggregate root' entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<Description>Abstractions to support DDD (Domain Driven Design) entity classes and DDD repository concepts.
</Description>
<WarningsAsErrors>1591;1573;</WarningsAsErrors> <!-- Not to be removed. Documentation is required. -->
<RootNamespace>Odin.DomainDrivenDesign</RootNamespace>
</PropertyGroup>
<ItemGroup>
<None Include="../../Assets/icon.png" Pack="true" PackagePath=""/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Linq.Expressions;

namespace Odin.DomainDrivenDesign;
namespace Odin.DDD.Repositories;

/// <summary>
/// Represents a repository query specification for filter criteria, preloading includes,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Odin.DomainDrivenDesign
namespace Odin.DDD.Repositories
{
/// <summary>
/// Represents a repository for persisting entities to a data store.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Linq.Expressions;

namespace Odin.DomainDrivenDesign;
namespace Odin.DDD.Repositories;

/// <summary>
/// Represents a repository query specification (filter criteria and preloading includes)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

namespace Odin.DomainDrivenDesign
namespace Odin.DDD.Repositories
{
/// <summary>
/// Intended to wrap DbContext.SaveChangesAsync to support domain event publishing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Linq.Expressions;
using System.Numerics;

namespace Odin.DomainDrivenDesign;
namespace Odin.DDD.Repositories;

/// <inheritdoc />
public abstract class IdentityQuerySpecification<TAggregateRoot, TId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Linq.Expressions;

namespace Odin.DomainDrivenDesign;
namespace Odin.DDD.Repositories;

/// <inheritdoc />
public class QuerySpecification<TAggregateRoot>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Linq.Expressions;

namespace Odin.DomainDrivenDesign;
namespace Odin.DDD.Repositories;

/// <summary>
/// Defines a query to find a single entity in a repository.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// using System.Numerics;
// using Microsoft.EntityFrameworkCore;
//
// namespace Odin.DomainDrivenDesign;
// namespace Odin.DDD;
//
// /// <summary>
// ///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ImplicitUsings>true</ImplicitUsings>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RootNamespace>Odin.DomainDrivenDesign</RootNamespace>
<RootNamespace>Odin.DDD</RootNamespace>
<Description>

</Description>
Expand All @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Abstractions\Odin.DomainDrivenDesign.Abstractions.csproj"/>
<ProjectReference Include="..\Abstractions\Odin.DDD.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// using System.Numerics;
//
// namespace Odin.DomainDrivenDesign;
// namespace Odin.DDD;
//
// /// <summary>
// /// Allows querying of an aggregate root by Id.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
using Microsoft.EntityFrameworkCore;

namespace Odin.DomainDrivenDesign
namespace Odin.DDD.Repositories
{
/// <summary>
/// Provides a base implementation for repositories that use Entity Framework Core for data access.
/// Exposes flexible FetchSingleAsync and FetchManyAsync query endpoints.
/// </summary>
/// <typeparam name="TAggregateRoot"></typeparam>
/// <typeparam name="TDbContext">The database context that must contain a DBSet of <typeparamref name="TAggregateRoot"/></typeparam>
public abstract class AbstractEntityFrameworkRepository<TAggregateRoot, TDbContext> : IRepository<TAggregateRoot>, IDisposable
/// <typeparam name="TDbContext">The database context that must contain a DBSet of <typeparamref name="TAggregateRoot"/>
/// We encapsulate save\commit under IUnitOfWork, in order that other commit-time aspects can be implemented,
/// the most notable being domain event publishing.</typeparam>
public abstract class EntityFrameworkRepositoryBase<TAggregateRoot, TDbContext> : IRepository<TAggregateRoot>, IDisposable
where TDbContext : DbContext, IUnitOfWork
where TAggregateRoot : class, IAggregateRoot
{
Expand All @@ -27,7 +29,7 @@ public abstract class AbstractEntityFrameworkRepository<TAggregateRoot, TDbConte
/// </summary>
/// <param name="dbContext"></param>
/// <exception cref="ArgumentNullException"></exception>
protected AbstractEntityFrameworkRepository(TDbContext dbContext)
protected EntityFrameworkRepositoryBase(TDbContext dbContext)
{
ArgumentNullException.ThrowIfNull(dbContext);
DbContext = dbContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ImplicitUsings>true</ImplicitUsings>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RootNamespace>Odin.DomainDrivenDesign</RootNamespace>
<RootNamespace>Odin.DDD.Repositories</RootNamespace>
<Description>

</Description>
Expand All @@ -12,11 +12,11 @@

<ItemGroup>
<None Include="../../Assets/icon.png" Pack="true" PackagePath=""/>
<None Include="..\README.md" Pack="true" PackagePath=""/>
<None Include="README.md" Pack="true" PackagePath=""/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Abstractions\Odin.DomainDrivenDesign.Abstractions.csproj"/>
<ProjectReference Include="..\..\DomainDrivenDesign\Core\Odin.DDD.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions DomainDrivenDesign/Repositories-EF/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## About Odin.DDD.Repositories~~~~
~~~~~~~~
33 changes: 33 additions & 0 deletions DomainDrivenDesign/Tests/AppFactory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.VisualStudio.TestPlatform.TestHost;

namespace Tests.Odin.DDD
{
public class AppFactory : WebApplicationFactory<Program>
{
// Nothing needed yet...
// protected override void ConfigureWebHost(IWebHostBuilder builder)
// {
// builder.ConfigureAppConfiguration((context, config) =>
// {
// // Add a specific test settings file if needed
// config.AddJsonFile("appsettings.Test.json", optional: true);
// });
//
// builder.ConfigureTestServices(services =>
// {
// // 1. Remove the real database registration
// // 2. Add a Mock or an In-Memory/Testcontainer version
// // Example: services.AddDbContext<MyDbContext>(options => options.UseInMemoryDatabase("TestDb"));
//
// // You can also mock external APIs here using Moq or NSubstitute
// });
//
// builder.UseEnvironment("Testing");
// }
//
// public override async ValueTask DisposeAsync()
// {
// }
}
}
Loading
Loading