-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: full audited entity model (#92)
- Loading branch information
Showing
49 changed files
with
713 additions
and
190 deletions.
There are no files selected for viewing
26 changes: 0 additions & 26 deletions
26
src/BB84.EntityFrameworkCore.Models.Abstractions/Components/IAudited.cs
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
src/BB84.EntityFrameworkCore.Models.Abstractions/Components/IConcurrency.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
namespace BB84.EntityFrameworkCore.Models.Abstractions.Components; | ||
|
||
/// <summary> | ||
/// The concurrency interface. | ||
/// The interface for concurrency based components. | ||
/// </summary> | ||
public interface IConcurrency | ||
{ | ||
/// <summary> | ||
/// The current timestamp or row version. | ||
/// The current timestamp or row version of the data row. | ||
/// </summary> | ||
byte[] Timestamp { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/BB84.EntityFrameworkCore.Models.Abstractions/Components/ISoftDeletable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
namespace BB84.EntityFrameworkCore.Models.Abstractions.Components; | ||
|
||
/// <summary> | ||
/// The soft deleteable interface. | ||
/// The interface for soft deleteable components. | ||
/// </summary> | ||
public interface ISoftDeletable | ||
{ | ||
/// <summary> | ||
/// Is the data row in a soft deleted state? | ||
/// Indicates if the data row in a soft deleted state. | ||
/// </summary> | ||
bool IsDeleted { get; set; } | ||
} |
17 changes: 17 additions & 0 deletions
17
src/BB84.EntityFrameworkCore.Models.Abstractions/Components/ITimeAudited.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace BB84.EntityFrameworkCore.Models.Abstractions.Components; | ||
|
||
/// <summary> | ||
/// The interface for time audited components. | ||
/// </summary> | ||
public interface ITimeAudited | ||
{ | ||
/// <summary> | ||
/// The initial creation time of the data row. | ||
/// </summary> | ||
DateTime Created { get; set; } | ||
|
||
/// <summary> | ||
/// The last editing time of the data row. | ||
/// </summary> | ||
DateTime? Edited { get; set; } | ||
} |
26 changes: 26 additions & 0 deletions
26
src/BB84.EntityFrameworkCore.Models.Abstractions/Components/IUserAudited.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace BB84.EntityFrameworkCore.Models.Abstractions.Components; | ||
|
||
/// <summary> | ||
/// The interface for user audited components. | ||
/// </summary> | ||
/// <typeparam name="TCreator">The type of the creator column.</typeparam> | ||
/// <typeparam name="TEditor">The type of the editor column.</typeparam> | ||
public interface IUserAudited<TCreator, TEditor> | ||
{ | ||
/// <summary> | ||
/// The initial creator of the data row. | ||
/// </summary> | ||
TCreator Creator { get; set; } | ||
|
||
/// <summary> | ||
/// The last editor of the data row. | ||
/// </summary> | ||
TEditor Editor { get; set; } | ||
} | ||
|
||
/// <inheritdoc cref="IUserAudited{TCreator, TEditor}"/> | ||
/// <remarks> | ||
/// The user auditing columns are of type <see cref="string"/>. | ||
/// </remarks> | ||
public interface IUserAudited : IUserAudited<string, string?> | ||
{ } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/BB84.EntityFrameworkCore.Models.Abstractions/IFullAuditedModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using BB84.EntityFrameworkCore.Models.Abstractions.Components; | ||
|
||
namespace BB84.EntityFrameworkCore.Models.Abstractions; | ||
|
||
/// <summary> | ||
/// The interface for full audited entities. | ||
/// </summary> | ||
/// <inheritdoc cref="IIdentity{TKey}"/> | ||
/// <inheritdoc cref="IUserAudited{TCreator, TEdited}"/> | ||
/// <inheritdoc cref="ITimeAudited"/> | ||
public interface IFullAuditedModel<TKey, TCreator, TEdited> : IIdentityModel<TKey>, IUserAudited<TCreator, TEdited>, ITimeAudited where TKey : IEquatable<TKey> | ||
{ } | ||
|
||
/// <inheritdoc cref="IFullAuditedModel{TKey, TCreator, TEdited}"/> | ||
/// <remarks> | ||
/// The user auditing columns are of type <see cref="string"/>. | ||
/// </remarks> | ||
public interface IFullAuditedModel<TKey> : IFullAuditedModel<TKey, string, string?>, IUserAudited where TKey : IEquatable<TKey> | ||
{ } | ||
|
||
/// <inheritdoc cref="IFullAuditedModel{TKey, TCreator, TEdited}"/> | ||
/// <remarks> | ||
/// The identity column is of type <see cref="Guid"/>. | ||
/// </remarks> | ||
public interface IFullAuditedModel<TCreator, TEdited> : IFullAuditedModel<Guid, TCreator, TEdited>, IIdentityModel | ||
{ } | ||
|
||
/// <inheritdoc cref="IFullAuditedModel{TKey, TCreator, TEdited}"/> | ||
/// <remarks> | ||
/// The identity column is of type <see cref="Guid"/>. | ||
/// The user auditing columns are of type <see cref="string"/>. | ||
/// </remarks> | ||
public interface IFullAuditedModel : IFullAuditedModel<Guid, string, string?>, IIdentityModel, IUserAudited | ||
{ } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.