Skip to content

Commit

Permalink
Added links to specification rule. Cleaned up usings
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmackay committed Nov 18, 2024
1 parent 996dad5 commit 8409563
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 37 deletions.
5 changes: 1 addition & 4 deletions src/Domain/Common/Base/AggregateRoot.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using SSW.CleanArchitecture.Domain.Common.Interfaces;
using System.ComponentModel.DataAnnotations.Schema;

namespace SSW.CleanArchitecture.Domain.Common.Base;
namespace SSW.CleanArchitecture.Domain.Common.Base;

/// <summary>
/// Cluster of objects treated as a single unit.
Expand Down
4 changes: 1 addition & 3 deletions src/Domain/Common/Base/Auditable.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using SSW.CleanArchitecture.Domain.Common.Interfaces;

namespace SSW.CleanArchitecture.Domain.Common.Base;
namespace SSW.CleanArchitecture.Domain.Common.Base;

/// <summary>
/// Tracks creation and modification of objects.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using ErrorOr;

namespace SSW.CleanArchitecture.Domain.Common.EventualConsistency;

public static class EventualConsistencyError
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using ErrorOr;

namespace SSW.CleanArchitecture.Domain.Common.EventualConsistency;

public class EventualConsistencyException : Exception
Expand Down
4 changes: 3 additions & 1 deletion src/Domain/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Global using directives

global using Ardalis.Specification;
global using static System.ArgumentException;
global using static System.ArgumentNullException;
global using static System.ArgumentOutOfRangeException;
global using SSW.CleanArchitecture.Domain.Common.Base;
global using SSW.CleanArchitecture.Domain.Common.EventualConsistency;
global using SSW.CleanArchitecture.Domain.Common.Interfaces;
global using ErrorOr;
global using ErrorOr;
global using Vogen;
1 change: 0 additions & 1 deletion src/Domain/Heroes/Hero.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using SSW.CleanArchitecture.Domain.Teams;
using Vogen;

namespace SSW.CleanArchitecture.Domain.Heroes;

Expand Down
2 changes: 0 additions & 2 deletions src/Domain/Heroes/HeroErrors.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using ErrorOr;

namespace SSW.CleanArchitecture.Domain.Heroes;

public static class HeroErrors
Expand Down
6 changes: 1 addition & 5 deletions src/Domain/Heroes/PowerLevelUpdatedEvent.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using ErrorOr;
using SSW.CleanArchitecture.Domain.Common.EventualConsistency;
using SSW.CleanArchitecture.Domain.Common.Interfaces;

namespace SSW.CleanArchitecture.Domain.Heroes;
namespace SSW.CleanArchitecture.Domain.Heroes;

public record PowerLevelUpdatedEvent(Hero Hero) : IDomainEvent
{
Expand Down
5 changes: 2 additions & 3 deletions src/Domain/Heroes/TeamByIdSpec.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Ardalis.Specification;

namespace SSW.CleanArchitecture.Domain.Heroes;
namespace SSW.CleanArchitecture.Domain.Heroes;

// For more on the Specification Pattern see: https://www.ssw.com.au/rules/use-specification-pattern/
public sealed class HeroByIdSpec : SingleResultSpecification<Hero>
{
public HeroByIdSpec(HeroId heroId)
Expand Down
4 changes: 1 addition & 3 deletions src/Domain/Teams/Mission.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Vogen;

namespace SSW.CleanArchitecture.Domain.Teams;
namespace SSW.CleanArchitecture.Domain.Teams;

// For strongly typed IDs, check out the rule: https://www.ssw.com.au/rules/do-you-use-strongly-typed-ids/
[ValueObject<Guid>]
Expand Down
2 changes: 0 additions & 2 deletions src/Domain/Teams/MissionErrors.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using ErrorOr;

namespace SSW.CleanArchitecture.Domain.Teams;

public static class MissionErrors
Expand Down
1 change: 0 additions & 1 deletion src/Domain/Teams/Team.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using SSW.CleanArchitecture.Domain.Heroes;
using Vogen;

namespace SSW.CleanArchitecture.Domain.Teams;

Expand Down
5 changes: 2 additions & 3 deletions src/Domain/Teams/TeamByIdSpec.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Ardalis.Specification;

namespace SSW.CleanArchitecture.Domain.Teams;
namespace SSW.CleanArchitecture.Domain.Teams;

// For more on the Specification Pattern see: https://www.ssw.com.au/rules/use-specification-pattern/
public sealed class TeamByIdSpec : SingleResultSpecification<Team>
{
public TeamByIdSpec(TeamId teamId)
Expand Down
2 changes: 0 additions & 2 deletions src/Domain/Teams/TeamErrors.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using ErrorOr;

namespace SSW.CleanArchitecture.Domain.Teams;

public static class TeamErrors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;
using SSW.CleanArchitecture.Domain.Common.EventualConsistency;
using SSW.CleanArchitecture.Domain.Common.Interfaces;
using SSW.CleanArchitecture.Infrastructure.Persistence;
using System.Transactions;

namespace SSW.CleanArchitecture.Infrastructure.Middleware;

Expand Down
1 change: 0 additions & 1 deletion tools/MigrationService/Worker.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MigrationService.Initializers;
using OpenTelemetry.Trace;
using System.Diagnostics;

namespace MigrationService;
Expand Down

0 comments on commit 8409563

Please sign in to comment.