Skip to content

Commit

Permalink
Bring entity key type back
Browse files Browse the repository at this point in the history
  • Loading branch information
rungwiroon committed Dec 11, 2023
1 parent c504953 commit cd0055d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>3.0.0-preview-3</Version>
<Version>3.0.0-preview-4</Version>
<Description>A library contains common code related to domain modeling.</Description>
<PackageProjectUrl>https://github.com/codehardth/Codehard.Common</PackageProjectUrl>
<RepositoryUrl>https://github.com/codehardth/Codehard.Common</RepositoryUrl>
Expand Down
19 changes: 18 additions & 1 deletion src/Codehard.Common/Codehard.Common.DomainModel/IEntity.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
namespace Codehard.Common.DomainModel;

[Obsolete]
public interface IEntityKey

Check warning on line 4 in src/Codehard.Common/Codehard.Common.DomainModel/IEntity.cs

View workflow job for this annotation

GitHub Actions / build-and-test-infra

Missing XML comment for publicly visible type or member 'IEntityKey'

Check warning on line 4 in src/Codehard.Common/Codehard.Common.DomainModel/IEntity.cs

View workflow job for this annotation

GitHub Actions / build-and-test-common

Missing XML comment for publicly visible type or member 'IEntityKey'
{
}

/// <summary>
/// Generic interface for entities with a key of type TKey.
/// </summary>
Expand All @@ -22,4 +27,16 @@ public interface IEntity
/// Gets a read-only collection of domain events associated with the entity.
/// </summary>
IReadOnlyCollection<IDomainEvent> Events { get; }
}
}

[Obsolete]
public record struct IntegerKey(int Value) : IEntityKey;

[Obsolete]
public record struct LongKey(long Value) : IEntityKey;

[Obsolete]
public record struct StringKey(string Value) : IEntityKey;

[Obsolete]
public record struct GuidKey(Guid Value) : IEntityKey;

0 comments on commit cd0055d

Please sign in to comment.